<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>String Utility Functions: GLib Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GLib Reference Manual">
<link rel="up" href="glib-utilities.html" title="GLib Utilities">
<link rel="prev" href="glib-utilities.html" title="GLib Utilities">
<link rel="next" href="glib-Character-Set-Conversion.html" title="Character Set Conversion">
<meta name="generator" content="GTK-Doc V1.26.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#glib-String-Utility-Functions.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="glib-utilities.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="glib-utilities.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="glib-Character-Set-Conversion.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="glib-String-Utility-Functions"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="glib-String-Utility-Functions.top_of_page"></a>String Utility Functions</span></h2>
<p>String Utility Functions — various string-related functions</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="glib-String-Utility-Functions.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strdup" title="g_strdup ()">g_strdup</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strndup" title="g_strndup ()">g_strndup</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strdupv" title="g_strdupv ()">g_strdupv</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strnfill" title="g_strnfill ()">g_strnfill</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-stpcpy" title="g_stpcpy ()">g_stpcpy</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strstr-len" title="g_strstr_len ()">g_strstr_len</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strrstr" title="g_strrstr ()">g_strrstr</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strrstr-len" title="g_strrstr_len ()">g_strrstr_len</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-str-has-prefix" title="g_str_has_prefix ()">g_str_has_prefix</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-str-has-suffix" title="g_str_has_suffix ()">g_str_has_suffix</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strcmp0" title="g_strcmp0 ()">g_strcmp0</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-str-to-ascii" title="g_str_to_ascii ()">g_str_to_ascii</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-str-tokenize-and-fold" title="g_str_tokenize_and_fold ()">g_str_tokenize_and_fold</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-str-match-string" title="g_str_match_string ()">g_str_match_string</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gsize" title="gsize"><span class="returnvalue">gsize</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strlcpy" title="g_strlcpy ()">g_strlcpy</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gsize" title="gsize"><span class="returnvalue">gsize</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strlcat" title="g_strlcat ()">g_strlcat</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strdup-printf" title="g_strdup_printf ()">g_strdup_printf</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strdup-vprintf" title="g_strdup_vprintf ()">g_strdup_vprintf</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-printf" title="g_printf ()">g_printf</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-vprintf" title="g_vprintf ()">g_vprintf</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-fprintf" title="g_fprintf ()">g_fprintf</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-vfprintf" title="g_vfprintf ()">g_vfprintf</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-sprintf" title="g_sprintf ()">g_sprintf</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-vsprintf" title="g_vsprintf ()">g_vsprintf</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-snprintf" title="g_snprintf ()">g_snprintf</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-vsnprintf" title="g_vsnprintf ()">g_vsnprintf</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-vasprintf" title="g_vasprintf ()">g_vasprintf</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gsize" title="gsize"><span class="returnvalue">gsize</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-printf-string-upper-bound" title="g_printf_string_upper_bound ()">g_printf_string_upper_bound</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-str-is-ascii" title="g_str_is_ascii ()">g_str_is_ascii</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-isalnum" title="g_ascii_isalnum ()">g_ascii_isalnum</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-isalpha" title="g_ascii_isalpha ()">g_ascii_isalpha</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-iscntrl" title="g_ascii_iscntrl ()">g_ascii_iscntrl</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-isdigit" title="g_ascii_isdigit ()">g_ascii_isdigit</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-isgraph" title="g_ascii_isgraph ()">g_ascii_isgraph</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-islower" title="g_ascii_islower ()">g_ascii_islower</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-isprint" title="g_ascii_isprint ()">g_ascii_isprint</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-ispunct" title="g_ascii_ispunct ()">g_ascii_ispunct</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-isspace" title="g_ascii_isspace ()">g_ascii_isspace</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-isupper" title="g_ascii_isupper ()">g_ascii_isupper</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-isxdigit" title="g_ascii_isxdigit ()">g_ascii_isxdigit</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-digit-value" title="g_ascii_digit_value ()">g_ascii_digit_value</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-xdigit-value" title="g_ascii_xdigit_value ()">g_ascii_xdigit_value</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-strcasecmp" title="g_ascii_strcasecmp ()">g_ascii_strcasecmp</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-strncasecmp" title="g_ascii_strncasecmp ()">g_ascii_strncasecmp</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-strup" title="g_ascii_strup ()">g_ascii_strup</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-strdown" title="g_ascii_strdown ()">g_ascii_strdown</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-tolower" title="g_ascii_tolower ()">g_ascii_tolower</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-toupper" title="g_ascii_toupper ()">g_ascii_toupper</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Strings.html#GString" title="struct GString"><span class="returnvalue">GString</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-string-ascii-up" title="g_string_ascii_up ()">g_string_ascii_up</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Strings.html#GString" title="struct GString"><span class="returnvalue">GString</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-string-ascii-down" title="g_string_ascii_down ()">g_string_ascii_down</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strup" title="g_strup ()">g_strup</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strdown" title="g_strdown ()">g_strdown</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strcasecmp" title="g_strcasecmp ()">g_strcasecmp</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strncasecmp" title="g_strncasecmp ()">g_strncasecmp</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strreverse" title="g_strreverse ()">g_strreverse</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gint64" title="gint64"><span class="returnvalue">gint64</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-strtoll" title="g_ascii_strtoll ()">g_ascii_strtoll</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#guint64" title="guint64"><span class="returnvalue">guint64</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-strtoull" title="g_ascii_strtoull ()">g_ascii_strtoull</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gdouble" title="gdouble"><span class="returnvalue">gdouble</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-strtod" title="g_ascii_strtod ()">g_ascii_strtod</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-dtostr" title="g_ascii_dtostr ()">g_ascii_dtostr</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-formatd" title="g_ascii_formatd ()">g_ascii_formatd</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gdouble" title="gdouble"><span class="returnvalue">gdouble</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strtod" title="g_strtod ()">g_strtod</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-string-to-signed" title="g_ascii_string_to_signed ()">g_ascii_string_to_signed</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-ascii-string-to-unsigned" title="g_ascii_string_to_unsigned ()">g_ascii_string_to_unsigned</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strchug" title="g_strchug ()">g_strchug</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strchomp" title="g_strchomp ()">g_strchomp</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strstrip" title="g_strstrip()">g_strstrip</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strdelimit" title="g_strdelimit ()">g_strdelimit</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strescape" title="g_strescape ()">g_strescape</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strcompress" title="g_strcompress ()">g_strcompress</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strcanon" title="g_strcanon ()">g_strcanon</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strsplit" title="g_strsplit ()">g_strsplit</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strsplit-set" title="g_strsplit_set ()">g_strsplit_set</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strfreev" title="g_strfreev ()">g_strfreev</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strconcat" title="g_strconcat ()">g_strconcat</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strjoin" title="g_strjoin ()">g_strjoin</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strjoinv" title="g_strjoinv ()">g_strjoinv</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#guint" title="guint ()"><span class="returnvalue">guint</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strv-length" title="g_strv_length ()">g_strv_length</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strv-contains" title="g_strv_contains ()">g_strv_contains</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strerror" title="g_strerror ()">g_strerror</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="glib-String-Utility-Functions.html#g-strsignal" title="g_strsignal ()">g_strsignal</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="glib-String-Utility-Functions.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="glib-String-Utility-Functions.html#G-ASCII-DTOSTR-BUF-SIZE:CAPS" title="G_ASCII_DTOSTR_BUF_SIZE">G_ASCII_DTOSTR_BUF_SIZE</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="glib-String-Utility-Functions.html#GNumberParserError" title="enum GNumberParserError">GNumberParserError</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="glib-String-Utility-Functions.html#G-NUMBER-PARSER-ERROR:CAPS" title="G_NUMBER_PARSER_ERROR">G_NUMBER_PARSER_ERROR</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="glib-String-Utility-Functions.html#G-STR-DELIMITERS:CAPS" title="G_STR_DELIMITERS">G_STR_DELIMITERS</a></td>
</tr>
<tr>
<td class="typedef_keyword">typedef</td>
<td class="function_name"><a class="link" href="glib-String-Utility-Functions.html#GStrv" title="GStrv">GStrv</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="glib-String-Utility-Functions.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;glib.h&gt;
#include &lt;glib/gprintf.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="glib-String-Utility-Functions.description"></a><h2>Description</h2>
<p>This section describes a number of utility functions for creating,
duplicating, and manipulating strings.</p>
<p>Note that the functions <a class="link" href="glib-String-Utility-Functions.html#g-printf" title="g_printf ()"><code class="function">g_printf()</code></a>, <a class="link" href="glib-String-Utility-Functions.html#g-fprintf" title="g_fprintf ()"><code class="function">g_fprintf()</code></a>, <a class="link" href="glib-String-Utility-Functions.html#g-sprintf" title="g_sprintf ()"><code class="function">g_sprintf()</code></a>,
<a class="link" href="glib-String-Utility-Functions.html#g-snprintf" title="g_snprintf ()"><code class="function">g_snprintf()</code></a>, <a class="link" href="glib-String-Utility-Functions.html#g-vprintf" title="g_vprintf ()"><code class="function">g_vprintf()</code></a>, <a class="link" href="glib-String-Utility-Functions.html#g-vfprintf" title="g_vfprintf ()"><code class="function">g_vfprintf()</code></a>, <a class="link" href="glib-String-Utility-Functions.html#g-vsprintf" title="g_vsprintf ()"><code class="function">g_vsprintf()</code></a> and <a class="link" href="glib-String-Utility-Functions.html#g-vsnprintf" title="g_vsnprintf ()"><code class="function">g_vsnprintf()</code></a>
are declared in the header <code class="literal">gprintf.h</code> which is not included in <code class="literal">glib.h</code>
(otherwise using <code class="literal">glib.h</code> would drag in <code class="literal">stdio.h</code>), so you'll have to
explicitly include <code class="literal">&amp;lt;glib/gprintf.h&gt;</code> in order to use the GLib
<code class="function">printf()</code> functions.</p>
<div class="refsect3">
<a name="string-precision"></a><h4>String precision pitfalls</h4>
<p>While you may use the <code class="function">printf()</code> functions to format UTF-8 strings,
notice that the precision of a %Ns parameter is interpreted
as the number of bytes, not characters to print. On top of that,
the GNU libc implementation of the <code class="function">printf()</code> functions has the
"feature" that it checks that the string given for the %Ns
parameter consists of a whole number of characters in the current
encoding. So, unless you are sure you are always going to be in an
UTF-8 locale or your know your text is restricted to ASCII, avoid
using %Ns. If your intention is to format strings for a
certain number of columns, then %Ns is not a correct solution
anyway, since it fails to take wide characters (see <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-iswide" title="g_unichar_iswide ()"><code class="function">g_unichar_iswide()</code></a>)
into account.</p>
<p>Note also that there are various <code class="function">printf()</code> parameters which are platform
dependent. GLib provides platform independent macros for these parameters
which should be used instead. A common example is <a class="link" href="glib-Basic-Types.html#G-GUINT64-FORMAT:CAPS" title="G_GUINT64_FORMAT"><code class="literal">G_GUINT64_FORMAT</code></a>, which
should be used instead of <code class="literal">%llu</code> or similar parameters for formatting
64-bit integers. These macros are all named <code class="literal">G_*_FORMAT</code>; see
<a class="link" href="glib-Basic-Types.html" title="Basic Types">Basic Types</a>.</p>
</div>
</div>
<div class="refsect1">
<a name="glib-String-Utility-Functions.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="g-strdup"></a><h3>g_strdup ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_strdup (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>);</pre>
<p>Duplicates a string. If <em class="parameter"><code>str</code></em>
 is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> it returns <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>.
The returned string should be freed with <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a>
when no longer needed.</p>
<div class="refsect3">
<a name="g-strdup.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>str</p></td>
<td class="parameter_description"><p>the string to duplicate. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strdup.returns"></a><h4>Returns</h4>
<p> a newly-allocated copy of <em class="parameter"><code>str</code></em>
</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strndup"></a><h3>g_strndup ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_strndup (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>,
           <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gsize" title="gsize"><span class="type">gsize</span></a> n</code></em>);</pre>
<p>Duplicates the first <em class="parameter"><code>n</code></em>
 bytes of a string, returning a newly-allocated
buffer <em class="parameter"><code>n</code></em>
 + 1 bytes long which will always be nul-terminated. If <em class="parameter"><code>str</code></em>

is less than <em class="parameter"><code>n</code></em>
 bytes long the buffer is padded with nuls. If <em class="parameter"><code>str</code></em>
 is
<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> it returns <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. The returned value should be freed when no longer
needed.</p>
<p>To copy a number of characters from a UTF-8 encoded string,
use <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-strncpy" title="g_utf8_strncpy ()"><code class="function">g_utf8_strncpy()</code></a> instead.</p>
<div class="refsect3">
<a name="g-strndup.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>str</p></td>
<td class="parameter_description"><p>the string to duplicate</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>n</p></td>
<td class="parameter_description"><p>the maximum number of bytes to copy from <em class="parameter"><code>str</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strndup.returns"></a><h4>Returns</h4>
<p> a newly-allocated buffer containing the first <em class="parameter"><code>n</code></em>
bytes
of <em class="parameter"><code>str</code></em>
, nul-terminated</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strdupv"></a><h3>g_strdupv ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **
g_strdupv (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> **str_array</code></em>);</pre>
<p>Copies <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated array of strings. The copy is a deep copy;
the new array should be freed by first freeing each string, then
the array itself. <a class="link" href="glib-String-Utility-Functions.html#g-strfreev" title="g_strfreev ()"><code class="function">g_strfreev()</code></a> does this for you. If called
on a <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> value, <a class="link" href="glib-String-Utility-Functions.html#g-strdupv" title="g_strdupv ()"><code class="function">g_strdupv()</code></a> simply returns <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>.</p>
<div class="refsect3">
<a name="g-strdupv.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>str_array</p></td>
<td class="parameter_description"><p>a <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated array of strings. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strdupv.returns"></a><h4>Returns</h4>
<p>a new <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated array of strings. </p>
<p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strnfill"></a><h3>g_strnfill ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_strnfill (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gsize" title="gsize"><span class="type">gsize</span></a> length</code></em>,
            <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> fill_char</code></em>);</pre>
<p>Creates a new string <em class="parameter"><code>length</code></em>
 bytes long filled with <em class="parameter"><code>fill_char</code></em>
.
The returned string should be freed when no longer needed.</p>
<div class="refsect3">
<a name="g-strnfill.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>length</p></td>
<td class="parameter_description"><p>the length of the new string</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>fill_char</p></td>
<td class="parameter_description"><p>the byte to fill the string with</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strnfill.returns"></a><h4>Returns</h4>
<p> a newly-allocated string filled the <em class="parameter"><code>fill_char</code></em>
</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-stpcpy"></a><h3>g_stpcpy ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_stpcpy (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *dest</code></em>,
          <em class="parameter"><code>const <span class="type">char</span> *src</code></em>);</pre>
<p>Copies a nul-terminated string into the dest buffer, include the
trailing nul, and return a pointer to the trailing nul byte.
This is useful for concatenating multiple strings together
without having to repeatedly scan for the end.</p>
<div class="refsect3">
<a name="g-stpcpy.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>dest</p></td>
<td class="parameter_description"><p>destination buffer.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>src</p></td>
<td class="parameter_description"><p>source string.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-stpcpy.returns"></a><h4>Returns</h4>
<p> a pointer to trailing nul byte.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strstr-len"></a><h3>g_strstr_len ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_strstr_len (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *haystack</code></em>,
              <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> haystack_len</code></em>,
              <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *needle</code></em>);</pre>
<p>Searches the string <em class="parameter"><code>haystack</code></em>
 for the first occurrence
of the string <em class="parameter"><code>needle</code></em>
, limiting the length of the search
to <em class="parameter"><code>haystack_len</code></em>
.</p>
<div class="refsect3">
<a name="g-strstr-len.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>haystack</p></td>
<td class="parameter_description"><p>a string</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>haystack_len</p></td>
<td class="parameter_description"><p>the maximum length of <em class="parameter"><code>haystack</code></em>
. Note that -1 is
a valid length, if <em class="parameter"><code>haystack</code></em>
is nul-terminated, meaning it will
search through the whole string.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>needle</p></td>
<td class="parameter_description"><p>the string to search for</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strstr-len.returns"></a><h4>Returns</h4>
<p> a pointer to the found occurrence, or
<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if not found.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strrstr"></a><h3>g_strrstr ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_strrstr (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *haystack</code></em>,
           <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *needle</code></em>);</pre>
<p>Searches the string <em class="parameter"><code>haystack</code></em>
 for the last occurrence
of the string <em class="parameter"><code>needle</code></em>
.</p>
<div class="refsect3">
<a name="g-strrstr.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>haystack</p></td>
<td class="parameter_description"><p>a nul-terminated string</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>needle</p></td>
<td class="parameter_description"><p>the nul-terminated string to search for</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strrstr.returns"></a><h4>Returns</h4>
<p> a pointer to the found occurrence, or
<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if not found.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strrstr-len"></a><h3>g_strrstr_len ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_strrstr_len (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *haystack</code></em>,
               <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> haystack_len</code></em>,
               <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *needle</code></em>);</pre>
<p>Searches the string <em class="parameter"><code>haystack</code></em>
 for the last occurrence
of the string <em class="parameter"><code>needle</code></em>
, limiting the length of the search
to <em class="parameter"><code>haystack_len</code></em>
.</p>
<div class="refsect3">
<a name="g-strrstr-len.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>haystack</p></td>
<td class="parameter_description"><p>a nul-terminated string</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>haystack_len</p></td>
<td class="parameter_description"><p>the maximum length of <em class="parameter"><code>haystack</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>needle</p></td>
<td class="parameter_description"><p>the nul-terminated string to search for</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strrstr-len.returns"></a><h4>Returns</h4>
<p> a pointer to the found occurrence, or
<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if not found.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-str-has-prefix"></a><h3>g_str_has_prefix ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
g_str_has_prefix (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>,
                  <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *prefix</code></em>);</pre>
<p>Looks whether the string <em class="parameter"><code>str</code></em>
 begins with <em class="parameter"><code>prefix</code></em>
.</p>
<div class="refsect3">
<a name="g-str-has-prefix.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>str</p></td>
<td class="parameter_description"><p>a nul-terminated string</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>prefix</p></td>
<td class="parameter_description"><p>the nul-terminated prefix to look for</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-str-has-prefix.returns"></a><h4>Returns</h4>
<p> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>str</code></em>
begins with <em class="parameter"><code>prefix</code></em>
, <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a> otherwise.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-2.html#api-index-2.2">2.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-str-has-suffix"></a><h3>g_str_has_suffix ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
g_str_has_suffix (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>,
                  <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *suffix</code></em>);</pre>
<p>Looks whether the string <em class="parameter"><code>str</code></em>
 ends with <em class="parameter"><code>suffix</code></em>
.</p>
<div class="refsect3">
<a name="g-str-has-suffix.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>str</p></td>
<td class="parameter_description"><p>a nul-terminated string</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>suffix</p></td>
<td class="parameter_description"><p>the nul-terminated suffix to look for</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-str-has-suffix.returns"></a><h4>Returns</h4>
<p> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>str</code></em>
end with <em class="parameter"><code>suffix</code></em>
, <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a> otherwise.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-2.html#api-index-2.2">2.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-strcmp0"></a><h3>g_strcmp0 ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
g_strcmp0 (<em class="parameter"><code>const <span class="type">char</span> *str1</code></em>,
           <em class="parameter"><code>const <span class="type">char</span> *str2</code></em>);</pre>
<p>Compares <em class="parameter"><code>str1</code></em>
 and <em class="parameter"><code>str2</code></em>
 like <code class="function">strcmp()</code>. Handles <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>
gracefully by sorting it before non-<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> strings.
Comparing two <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> pointers returns 0.</p>
<div class="refsect3">
<a name="g-strcmp0.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>str1</p></td>
<td class="parameter_description"><p>a C string or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>str2</p></td>
<td class="parameter_description"><p>another C string or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strcmp0.returns"></a><h4>Returns</h4>
<p> an integer less than, equal to, or greater than zero, if <em class="parameter"><code>str1</code></em>
is &lt;, == or &gt; than <em class="parameter"><code>str2</code></em>
.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-16.html#api-index-2.16">2.16</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-str-to-ascii"></a><h3>g_str_to_ascii ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_str_to_ascii (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>,
                <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *from_locale</code></em>);</pre>
<p>Transliterate <em class="parameter"><code>str</code></em>
 to plain ASCII.</p>
<p>For best results, <em class="parameter"><code>str</code></em>
 should be in composed normalised form.</p>
<p>This function performs a reasonably good set of character
replacements.  The particular set of replacements that is done may
change by version or even by runtime environment.</p>
<p>If the source language of <em class="parameter"><code>str</code></em>
 is known, it can used to improve the
accuracy of the translation by passing it as <em class="parameter"><code>from_locale</code></em>
.  It should
be a valid POSIX locale string (of the form
"language_territory[<em class="parameter"><code>modifier</code></em>
]").</p>
<p>If <em class="parameter"><code>from_locale</code></em>
 is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> then the current locale is used.</p>
<p>If you want to do translation for no specific locale, and you want it
to be done independently of the currently locale, specify "C" for
<em class="parameter"><code>from_locale</code></em>
.</p>
<div class="refsect3">
<a name="g-str-to-ascii.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>str</p></td>
<td class="parameter_description"><p>a string, in UTF-8</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>from_locale</p></td>
<td class="parameter_description"><p>the source locale, if known. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-str-to-ascii.returns"></a><h4>Returns</h4>
<p> a string in plain ASCII</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-40.html#api-index-2.40">2.40</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-str-tokenize-and-fold"></a><h3>g_str_tokenize_and_fold ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **
g_str_tokenize_and_fold (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>,
                         <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *translit_locale</code></em>,
                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> ***ascii_alternates</code></em>);</pre>
<p>Tokenises <em class="parameter"><code>string</code></em>
 and performs folding on each token.</p>
<p>A token is a non-empty sequence of alphanumeric characters in the
source string, separated by non-alphanumeric characters.  An
"alphanumeric" character for this purpose is one that matches
<a class="link" href="glib-Unicode-Manipulation.html#g-unichar-isalnum" title="g_unichar_isalnum ()"><code class="function">g_unichar_isalnum()</code></a> or <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-ismark" title="g_unichar_ismark ()"><code class="function">g_unichar_ismark()</code></a>.</p>
<p>Each token is then (Unicode) normalised and case-folded.  If
<em class="parameter"><code>ascii_alternates</code></em>
 is non-<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> and some of the returned tokens
contain non-ASCII characters, ASCII alternatives will be generated.</p>
<p>The number of ASCII alternatives that are generated and the method
for doing so is unspecified, but <em class="parameter"><code>translit_locale</code></em>
 (if specified) may
improve the transliteration if the language of the source string is
known.</p>
<div class="refsect3">
<a name="g-str-tokenize-and-fold.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description"><p>a string</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>translit_locale</p></td>
<td class="parameter_description"><p>the language code (like 'de' or
'en_GB') from which <em class="parameter"><code>string</code></em>
originates. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>ascii_alternates</p></td>
<td class="parameter_description"><p>a
return location for ASCII alternates. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-str-tokenize-and-fold.returns"></a><h4>Returns</h4>
<p>the folded tokens. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-40.html#api-index-2.40">2.40</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-str-match-string"></a><h3>g_str_match_string ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
g_str_match_string (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *search_term</code></em>,
                    <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *potential_hit</code></em>,
                    <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="type">gboolean</span></a> accept_alternates</code></em>);</pre>
<p>Checks if a search conducted for <em class="parameter"><code>search_term</code></em>
 should match
<em class="parameter"><code>potential_hit</code></em>
.</p>
<p>This function calls <a class="link" href="glib-String-Utility-Functions.html#g-str-tokenize-and-fold" title="g_str_tokenize_and_fold ()"><code class="function">g_str_tokenize_and_fold()</code></a> on both
<em class="parameter"><code>search_term</code></em>
 and <em class="parameter"><code>potential_hit</code></em>
.  ASCII alternates are never taken
for <em class="parameter"><code>search_term</code></em>
 but will be taken for <em class="parameter"><code>potential_hit</code></em>
 according to
the value of <em class="parameter"><code>accept_alternates</code></em>
.</p>
<p>A hit occurs when each folded token in <em class="parameter"><code>search_term</code></em>
 is a prefix of a
folded token from <em class="parameter"><code>potential_hit</code></em>
.</p>
<p>Depending on how you're performing the search, it will typically be
faster to call <a class="link" href="glib-String-Utility-Functions.html#g-str-tokenize-and-fold" title="g_str_tokenize_and_fold ()"><code class="function">g_str_tokenize_and_fold()</code></a> on each string in
your corpus and build an index on the returned folded tokens, then
call <a class="link" href="glib-String-Utility-Functions.html#g-str-tokenize-and-fold" title="g_str_tokenize_and_fold ()"><code class="function">g_str_tokenize_and_fold()</code></a> on the search term and
perform lookups into that index.</p>
<p>As some examples, searching for "fred" would match the potential hit
"Smith, Fred" and also "Frédéric".  Searching for "Fréd" would match
"Frédéric" but not "Frederic" (due to the one-directional nature of
accent matching).  Searching "fo" would match "Foo" and "Bar Foo
Baz", but not "SFO" (because no word as "fo" as a prefix).</p>
<div class="refsect3">
<a name="g-str-match-string.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>search_term</p></td>
<td class="parameter_description"><p>the search term from the user</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>potential_hit</p></td>
<td class="parameter_description"><p>the text that may be a hit</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>accept_alternates</p></td>
<td class="parameter_description"><p><a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> to accept ASCII alternates</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-str-match-string.returns"></a><h4>Returns</h4>
<p> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>potential_hit</code></em>
is a hit</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-40.html#api-index-2.40">2.40</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-strlcpy"></a><h3>g_strlcpy ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gsize" title="gsize"><span class="returnvalue">gsize</span></a>
g_strlcpy (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *dest</code></em>,
           <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *src</code></em>,
           <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gsize" title="gsize"><span class="type">gsize</span></a> dest_size</code></em>);</pre>
<p>Portability wrapper that calls <code class="function">strlcpy()</code> on systems which have it,
and emulates <code class="function">strlcpy()</code> otherwise. Copies <em class="parameter"><code>src</code></em>
 to <em class="parameter"><code>dest</code></em>
; <em class="parameter"><code>dest</code></em>
 is
guaranteed to be nul-terminated; <em class="parameter"><code>src</code></em>
 must be nul-terminated;
<em class="parameter"><code>dest_size</code></em>
 is the buffer size, not the number of bytes to copy.</p>
<p>At most <em class="parameter"><code>dest_size</code></em>
 - 1 characters will be copied. Always nul-terminates
(unless <em class="parameter"><code>dest_size</code></em>
 is 0). This function does not allocate memory. Unlike
<code class="function">strncpy()</code>, this function doesn't pad <em class="parameter"><code>dest</code></em>
 (so it's often faster). It
returns the size of the attempted result, strlen (src), so if
<em class="parameter"><code>retval</code></em>
 &gt;= <em class="parameter"><code>dest_size</code></em>
, truncation occurred.</p>
<p>Caveat: <code class="function">strlcpy()</code> is supposedly more secure than <code class="function">strcpy()</code> or <code class="function">strncpy()</code>,
but if you really want to avoid screwups, <a class="link" href="glib-String-Utility-Functions.html#g-strdup" title="g_strdup ()"><code class="function">g_strdup()</code></a> is an even better
idea.</p>
<div class="refsect3">
<a name="g-strlcpy.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>dest</p></td>
<td class="parameter_description"><p>destination buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>src</p></td>
<td class="parameter_description"><p>source buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>dest_size</p></td>
<td class="parameter_description"><p>length of <em class="parameter"><code>dest</code></em>
in bytes</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strlcpy.returns"></a><h4>Returns</h4>
<p> length of <em class="parameter"><code>src</code></em>
</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strlcat"></a><h3>g_strlcat ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gsize" title="gsize"><span class="returnvalue">gsize</span></a>
g_strlcat (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *dest</code></em>,
           <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *src</code></em>,
           <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gsize" title="gsize"><span class="type">gsize</span></a> dest_size</code></em>);</pre>
<p>Portability wrapper that calls <code class="function">strlcat()</code> on systems which have it,
and emulates it otherwise. Appends nul-terminated <em class="parameter"><code>src</code></em>
 string to <em class="parameter"><code>dest</code></em>
,
guaranteeing nul-termination for <em class="parameter"><code>dest</code></em>
. The total size of <em class="parameter"><code>dest</code></em>
 won't
exceed <em class="parameter"><code>dest_size</code></em>
.</p>
<p>At most <em class="parameter"><code>dest_size</code></em>
 - 1 characters will be copied. Unlike <code class="function">strncat()</code>,
<em class="parameter"><code>dest_size</code></em>
 is the full size of dest, not the space left over. This
function does not allocate memory. It always nul-terminates (unless
<em class="parameter"><code>dest_size</code></em>
 == 0 or there were no nul characters in the <em class="parameter"><code>dest_size</code></em>

characters of dest to start with).</p>
<p>Caveat: this is supposedly a more secure alternative to <code class="function">strcat()</code> or
<code class="function">strncat()</code>, but for real security <a class="link" href="glib-String-Utility-Functions.html#g-strconcat" title="g_strconcat ()"><code class="function">g_strconcat()</code></a> is harder to mess up.</p>
<div class="refsect3">
<a name="g-strlcat.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>dest</p></td>
<td class="parameter_description"><p>destination buffer, already containing one nul-terminated string</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>src</p></td>
<td class="parameter_description"><p>source buffer</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>dest_size</p></td>
<td class="parameter_description"><p>length of <em class="parameter"><code>dest</code></em>
buffer in bytes (not length of existing string
inside <em class="parameter"><code>dest</code></em>
)</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strlcat.returns"></a><h4>Returns</h4>
<p> size of attempted result, which is MIN (dest_size, strlen
(original dest)) + strlen (src), so if retval &gt;= dest_size,
truncation occurred.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strdup-printf"></a><h3>g_strdup_printf ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_strdup_printf (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *format</code></em>,
                 <em class="parameter"><code>...</code></em>);</pre>
<p>Similar to the standard C <code class="function">sprintf()</code> function but safer, since it
calculates the maximum space required and allocates memory to hold
the result. The returned string should be freed with <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a> when no
longer needed.</p>
<div class="refsect3">
<a name="g-strdup-printf.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>a standard <code class="function">printf()</code> format string, but notice
<a class="link" href="glib-String-Utility-Functions.html#string-precision" title="String precision pitfalls">string precision pitfalls</a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p>the parameters to insert into the format string</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strdup-printf.returns"></a><h4>Returns</h4>
<p> a newly-allocated string holding the result</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strdup-vprintf"></a><h3>g_strdup_vprintf ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_strdup_vprintf (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *format</code></em>,
                  <em class="parameter"><code><span class="type">va_list</span> args</code></em>);</pre>
<p>Similar to the standard C <code class="function">vsprintf()</code> function but safer, since it
calculates the maximum space required and allocates memory to hold
the result. The returned string should be freed with <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a> when
no longer needed.</p>
<p>See also <a class="link" href="glib-String-Utility-Functions.html#g-vasprintf" title="g_vasprintf ()"><code class="function">g_vasprintf()</code></a>, which offers the same functionality, but
additionally returns the length of the allocated string.</p>
<div class="refsect3">
<a name="g-strdup-vprintf.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>a standard <code class="function">printf()</code> format string, but notice
<a class="link" href="glib-String-Utility-Functions.html#string-precision" title="String precision pitfalls">string precision pitfalls</a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>args</p></td>
<td class="parameter_description"><p>the list of parameters to insert into the format string</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strdup-vprintf.returns"></a><h4>Returns</h4>
<p> a newly-allocated string holding the result</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-printf"></a><h3>g_printf ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
g_printf (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> const *format</code></em>,
          <em class="parameter"><code>...</code></em>);</pre>
<p>An implementation of the standard <code class="function">printf()</code> function which supports 
positional parameters, as specified in the Single Unix Specification.</p>
<p>As with the standard <code class="function">printf()</code>, this does not automatically append a trailing
new-line character to the message, so typically <em class="parameter"><code>format</code></em>
 should end with its
own new-line character.</p>
<div class="refsect3">
<a name="g-printf.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>a standard <code class="function">printf()</code> format string, but notice
<a class="link" href="glib-String-Utility-Functions.html#string-precision" title="String precision pitfalls">string precision pitfalls</a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p>the arguments to insert in the output.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-printf.returns"></a><h4>Returns</h4>
<p> the number of bytes printed.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-2.html#api-index-2.2">2.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-vprintf"></a><h3>g_vprintf ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
g_vprintf (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> const *format</code></em>,
           <em class="parameter"><code><span class="type">va_list</span> args</code></em>);</pre>
<p>An implementation of the standard <code class="function">vprintf()</code> function which supports 
positional parameters, as specified in the Single Unix Specification.</p>
<div class="refsect3">
<a name="g-vprintf.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>a standard <code class="function">printf()</code> format string, but notice
<a class="link" href="glib-String-Utility-Functions.html#string-precision" title="String precision pitfalls">string precision pitfalls</a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>args</p></td>
<td class="parameter_description"><p>the list of arguments to insert in the output.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-vprintf.returns"></a><h4>Returns</h4>
<p> the number of bytes printed.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-2.html#api-index-2.2">2.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-fprintf"></a><h3>g_fprintf ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
g_fprintf (<em class="parameter"><code><span class="type">FILE</span> *file</code></em>,
           <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> const *format</code></em>,
           <em class="parameter"><code>...</code></em>);</pre>
<p>An implementation of the standard <code class="function">fprintf()</code> function which supports 
positional parameters, as specified in the Single Unix Specification.</p>
<div class="refsect3">
<a name="g-fprintf.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>file</p></td>
<td class="parameter_description"><p>the stream to write to. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL must not be passed as the value in, out, in-out; or as a return value."><span class="acronym">not nullable</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>a standard <code class="function">printf()</code> format string, but notice
<a class="link" href="glib-String-Utility-Functions.html#string-precision" title="String precision pitfalls">string precision pitfalls</a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p>the arguments to insert in the output.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-fprintf.returns"></a><h4>Returns</h4>
<p> the number of bytes printed.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-2.html#api-index-2.2">2.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-vfprintf"></a><h3>g_vfprintf ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
g_vfprintf (<em class="parameter"><code><span class="type">FILE</span> *file</code></em>,
            <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> const *format</code></em>,
            <em class="parameter"><code><span class="type">va_list</span> args</code></em>);</pre>
<p>An implementation of the standard <code class="function">fprintf()</code> function which supports 
positional parameters, as specified in the Single Unix Specification.</p>
<div class="refsect3">
<a name="g-vfprintf.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>file</p></td>
<td class="parameter_description"><p>the stream to write to. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL must not be passed as the value in, out, in-out; or as a return value."><span class="acronym">not nullable</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>a standard <code class="function">printf()</code> format string, but notice
<a class="link" href="glib-String-Utility-Functions.html#string-precision" title="String precision pitfalls">string precision pitfalls</a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>args</p></td>
<td class="parameter_description"><p>the list of arguments to insert in the output.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-vfprintf.returns"></a><h4>Returns</h4>
<p> the number of bytes printed.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-2.html#api-index-2.2">2.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-sprintf"></a><h3>g_sprintf ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
g_sprintf (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>,
           <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> const *format</code></em>,
           <em class="parameter"><code>...</code></em>);</pre>
<p>An implementation of the standard <code class="function">sprintf()</code> function which supports
positional parameters, as specified in the Single Unix Specification.</p>
<p>Note that it is usually better to use <a class="link" href="glib-String-Utility-Functions.html#g-snprintf" title="g_snprintf ()"><code class="function">g_snprintf()</code></a>, to avoid the
risk of buffer overflow.</p>
<p>See also <a class="link" href="glib-String-Utility-Functions.html#g-strdup-printf" title="g_strdup_printf ()"><code class="function">g_strdup_printf()</code></a>.</p>
<div class="refsect3">
<a name="g-sprintf.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description"><p>A pointer to a memory buffer to contain the resulting string. It
is up to the caller to ensure that the allocated buffer is large
enough to hold the formatted result</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>a standard <code class="function">printf()</code> format string, but notice
<a class="link" href="glib-String-Utility-Functions.html#string-precision" title="String precision pitfalls">string precision pitfalls</a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p>the arguments to insert in the output.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-sprintf.returns"></a><h4>Returns</h4>
<p> the number of bytes printed.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-2.html#api-index-2.2">2.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-vsprintf"></a><h3>g_vsprintf ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
g_vsprintf (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>,
            <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> const *format</code></em>,
            <em class="parameter"><code><span class="type">va_list</span> args</code></em>);</pre>
<p>An implementation of the standard <code class="function">vsprintf()</code> function which supports 
positional parameters, as specified in the Single Unix Specification.</p>
<div class="refsect3">
<a name="g-vsprintf.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description"><p>the buffer to hold the output.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>a standard <code class="function">printf()</code> format string, but notice
<a class="link" href="glib-String-Utility-Functions.html#string-precision" title="String precision pitfalls">string precision pitfalls</a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>args</p></td>
<td class="parameter_description"><p>the list of arguments to insert in the output.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-vsprintf.returns"></a><h4>Returns</h4>
<p> the number of bytes printed.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-2.html#api-index-2.2">2.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-snprintf"></a><h3>g_snprintf ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
g_snprintf (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>,
            <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gulong" title="gulong"><span class="type">gulong</span></a> n</code></em>,
            <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> const *format</code></em>,
            <em class="parameter"><code>...</code></em>);</pre>
<p>A safer form of the standard <code class="function">sprintf()</code> function. The output is guaranteed
to not exceed <em class="parameter"><code>n</code></em>
 characters (including the terminating nul character), so
it is easy to ensure that a buffer overflow cannot occur.</p>
<p>See also <a class="link" href="glib-String-Utility-Functions.html#g-strdup-printf" title="g_strdup_printf ()"><code class="function">g_strdup_printf()</code></a>.</p>
<p>In versions of GLib prior to 1.2.3, this function may return -1 if the
output was truncated, and the truncated string may not be nul-terminated.
In versions prior to 1.3.12, this function returns the length of the output
string.</p>
<p>The return value of <a class="link" href="glib-String-Utility-Functions.html#g-snprintf" title="g_snprintf ()"><code class="function">g_snprintf()</code></a> conforms to the <code class="function">snprintf()</code>
function as standardized in ISO C99. Note that this is different from
traditional <code class="function">snprintf()</code>, which returns the length of the output string.</p>
<p>The format string may contain positional parameters, as specified in
the Single Unix Specification.</p>
<div class="refsect3">
<a name="g-snprintf.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description"><p>the buffer to hold the output.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>n</p></td>
<td class="parameter_description"><p>the maximum number of bytes to produce (including the
terminating nul character).</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>a standard <code class="function">printf()</code> format string, but notice
<a class="link" href="glib-String-Utility-Functions.html#string-precision" title="String precision pitfalls">string precision pitfalls</a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p>the arguments to insert in the output.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-snprintf.returns"></a><h4>Returns</h4>
<p> the number of bytes which would be produced if the buffer
was large enough.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-vsnprintf"></a><h3>g_vsnprintf ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
g_vsnprintf (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>,
             <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gulong" title="gulong"><span class="type">gulong</span></a> n</code></em>,
             <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> const *format</code></em>,
             <em class="parameter"><code><span class="type">va_list</span> args</code></em>);</pre>
<p>A safer form of the standard <code class="function">vsprintf()</code> function. The output is guaranteed
to not exceed <em class="parameter"><code>n</code></em>
 characters (including the terminating nul character), so 
it is easy to ensure that a buffer overflow cannot occur.</p>
<p>See also <a class="link" href="glib-String-Utility-Functions.html#g-strdup-vprintf" title="g_strdup_vprintf ()"><code class="function">g_strdup_vprintf()</code></a>.</p>
<p>In versions of GLib prior to 1.2.3, this function may return -1 if the 
output was truncated, and the truncated string may not be nul-terminated.
In versions prior to 1.3.12, this function returns the length of the output 
string.</p>
<p>The return value of <a class="link" href="glib-String-Utility-Functions.html#g-vsnprintf" title="g_vsnprintf ()"><code class="function">g_vsnprintf()</code></a> conforms to the <code class="function">vsnprintf()</code> function 
as standardized in ISO C99. Note that this is different from traditional 
<code class="function">vsnprintf()</code>, which returns the length of the output string.</p>
<p>The format string may contain positional parameters, as specified in 
the Single Unix Specification.</p>
<div class="refsect3">
<a name="g-vsnprintf.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description"><p>the buffer to hold the output.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>n</p></td>
<td class="parameter_description"><p>the maximum number of bytes to produce (including the
terminating nul character).</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>a standard <code class="function">printf()</code> format string, but notice
string precision pitfalls][string-precision]</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>args</p></td>
<td class="parameter_description"><p>the list of arguments to insert in the output.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-vsnprintf.returns"></a><h4>Returns</h4>
<p> the number of bytes which would be produced if the buffer
was large enough.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-vasprintf"></a><h3>g_vasprintf ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
g_vasprintf (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> **string</code></em>,
             <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> const *format</code></em>,
             <em class="parameter"><code><span class="type">va_list</span> args</code></em>);</pre>
<p>An implementation of the GNU <code class="function">vasprintf()</code> function which supports 
positional parameters, as specified in the Single Unix Specification.
This function is similar to <a class="link" href="glib-String-Utility-Functions.html#g-vsprintf" title="g_vsprintf ()"><code class="function">g_vsprintf()</code></a>, except that it allocates a 
string to hold the output, instead of putting the output in a buffer 
you allocate in advance.</p>
<div class="refsect3">
<a name="g-vasprintf.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description"><p>the return location for the newly-allocated string.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>a standard <code class="function">printf()</code> format string, but notice
<a class="link" href="glib-String-Utility-Functions.html#string-precision" title="String precision pitfalls">string precision pitfalls</a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>args</p></td>
<td class="parameter_description"><p>the list of arguments to insert in the output.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-vasprintf.returns"></a><h4>Returns</h4>
<p> the number of bytes printed.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-4.html#api-index-2.4">2.4</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-printf-string-upper-bound"></a><h3>g_printf_string_upper_bound ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gsize" title="gsize"><span class="returnvalue">gsize</span></a>
g_printf_string_upper_bound (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *format</code></em>,
                             <em class="parameter"><code><span class="type">va_list</span> args</code></em>);</pre>
<p>Calculates the maximum space needed to store the output
of the <code class="function">sprintf()</code> function.</p>
<div class="refsect3">
<a name="g-printf-string-upper-bound.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>the format string. See the <code class="function">printf()</code> documentation</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>args</p></td>
<td class="parameter_description"><p>the parameters to be inserted into the format string</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-printf-string-upper-bound.returns"></a><h4>Returns</h4>
<p> the maximum space needed to store the formatted string</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-str-is-ascii"></a><h3>g_str_is_ascii ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
g_str_is_ascii (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>);</pre>
<p>Determines if a string is pure ASCII. A string is pure ASCII if it
contains no bytes with the high bit set.</p>
<div class="refsect3">
<a name="g-str-is-ascii.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>str</p></td>
<td class="parameter_description"><p>a string</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-str-is-ascii.returns"></a><h4>Returns</h4>
<p> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>str</code></em>
is ASCII</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-40.html#api-index-2.40">2.40</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-isalnum"></a><h3>g_ascii_isalnum ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
g_ascii_isalnum (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> c</code></em>);</pre>
<p>Determines whether a character is alphanumeric.</p>
<p>Unlike the standard C library <code class="function">isalnum()</code> function, this only
recognizes standard ASCII letters and ignores the locale,
returning <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a> for all non-ASCII characters. Also, unlike
the standard library function, this takes a char, not an int,
so don't call it on <code class="literal">EOF</code>, but no need to cast to <a class="link" href="glib-Basic-Types.html#guchar" title="guchar"><span class="type">guchar</span></a> before
passing a possibly non-ASCII character in.</p>
<div class="refsect3">
<a name="g-ascii-isalnum.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>c</p></td>
<td class="parameter_description"><p>any character</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-isalnum.returns"></a><h4>Returns</h4>
<p> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>c</code></em>
is an ASCII alphanumeric character</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-isalpha"></a><h3>g_ascii_isalpha ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
g_ascii_isalpha (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> c</code></em>);</pre>
<p>Determines whether a character is alphabetic (i.e. a letter).</p>
<p>Unlike the standard C library <code class="function">isalpha()</code> function, this only
recognizes standard ASCII letters and ignores the locale,
returning <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a> for all non-ASCII characters. Also, unlike
the standard library function, this takes a char, not an int,
so don't call it on <code class="literal">EOF</code>, but no need to cast to <a class="link" href="glib-Basic-Types.html#guchar" title="guchar"><span class="type">guchar</span></a> before
passing a possibly non-ASCII character in.</p>
<div class="refsect3">
<a name="g-ascii-isalpha.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>c</p></td>
<td class="parameter_description"><p>any character</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-isalpha.returns"></a><h4>Returns</h4>
<p> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>c</code></em>
is an ASCII alphabetic character</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-iscntrl"></a><h3>g_ascii_iscntrl ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
g_ascii_iscntrl (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> c</code></em>);</pre>
<p>Determines whether a character is a control character.</p>
<p>Unlike the standard C library <code class="function">iscntrl()</code> function, this only
recognizes standard ASCII control characters and ignores the
locale, returning <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a> for all non-ASCII characters. Also,
unlike the standard library function, this takes a char, not
an int, so don't call it on <code class="literal">EOF</code>, but no need to cast to <a class="link" href="glib-Basic-Types.html#guchar" title="guchar"><span class="type">guchar</span></a>
before passing a possibly non-ASCII character in.</p>
<div class="refsect3">
<a name="g-ascii-iscntrl.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>c</p></td>
<td class="parameter_description"><p>any character</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-iscntrl.returns"></a><h4>Returns</h4>
<p> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>c</code></em>
is an ASCII control character.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-isdigit"></a><h3>g_ascii_isdigit ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
g_ascii_isdigit (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> c</code></em>);</pre>
<p>Determines whether a character is digit (0-9).</p>
<p>Unlike the standard C library <code class="function">isdigit()</code> function, this takes
a char, not an int, so don't call it  on <code class="literal">EOF</code>, but no need to
cast to <a class="link" href="glib-Basic-Types.html#guchar" title="guchar"><span class="type">guchar</span></a> before passing a possibly non-ASCII character in.</p>
<div class="refsect3">
<a name="g-ascii-isdigit.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>c</p></td>
<td class="parameter_description"><p>any character</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-isdigit.returns"></a><h4>Returns</h4>
<p> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>c</code></em>
is an ASCII digit.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-isgraph"></a><h3>g_ascii_isgraph ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
g_ascii_isgraph (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> c</code></em>);</pre>
<p>Determines whether a character is a printing character and not a space.</p>
<p>Unlike the standard C library <code class="function">isgraph()</code> function, this only
recognizes standard ASCII characters and ignores the locale,
returning <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a> for all non-ASCII characters. Also, unlike
the standard library function, this takes a char, not an int,
so don't call it on <code class="literal">EOF</code>, but no need to cast to <a class="link" href="glib-Basic-Types.html#guchar" title="guchar"><span class="type">guchar</span></a> before
passing a possibly non-ASCII character in.</p>
<div class="refsect3">
<a name="g-ascii-isgraph.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>c</p></td>
<td class="parameter_description"><p>any character</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-isgraph.returns"></a><h4>Returns</h4>
<p> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>c</code></em>
is an ASCII printing character other than space.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-islower"></a><h3>g_ascii_islower ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
g_ascii_islower (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> c</code></em>);</pre>
<p>Determines whether a character is an ASCII lower case letter.</p>
<p>Unlike the standard C library <code class="function">islower()</code> function, this only
recognizes standard ASCII letters and ignores the locale,
returning <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a> for all non-ASCII characters. Also, unlike
the standard library function, this takes a char, not an int,
so don't call it on <code class="literal">EOF</code>, but no need to worry about casting
to <a class="link" href="glib-Basic-Types.html#guchar" title="guchar"><span class="type">guchar</span></a> before passing a possibly non-ASCII character in.</p>
<div class="refsect3">
<a name="g-ascii-islower.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>c</p></td>
<td class="parameter_description"><p>any character</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-islower.returns"></a><h4>Returns</h4>
<p> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>c</code></em>
is an ASCII lower case letter</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-isprint"></a><h3>g_ascii_isprint ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
g_ascii_isprint (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> c</code></em>);</pre>
<p>Determines whether a character is a printing character.</p>
<p>Unlike the standard C library <code class="function">isprint()</code> function, this only
recognizes standard ASCII characters and ignores the locale,
returning <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a> for all non-ASCII characters. Also, unlike
the standard library function, this takes a char, not an int,
so don't call it on <code class="literal">EOF</code>, but no need to cast to <a class="link" href="glib-Basic-Types.html#guchar" title="guchar"><span class="type">guchar</span></a> before
passing a possibly non-ASCII character in.</p>
<div class="refsect3">
<a name="g-ascii-isprint.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>c</p></td>
<td class="parameter_description"><p>any character</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-isprint.returns"></a><h4>Returns</h4>
<p> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>c</code></em>
is an ASCII printing character.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-ispunct"></a><h3>g_ascii_ispunct ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
g_ascii_ispunct (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> c</code></em>);</pre>
<p>Determines whether a character is a punctuation character.</p>
<p>Unlike the standard C library <code class="function">ispunct()</code> function, this only
recognizes standard ASCII letters and ignores the locale,
returning <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a> for all non-ASCII characters. Also, unlike
the standard library function, this takes a char, not an int,
so don't call it on <code class="literal">EOF</code>, but no need to cast to <a class="link" href="glib-Basic-Types.html#guchar" title="guchar"><span class="type">guchar</span></a> before
passing a possibly non-ASCII character in.</p>
<div class="refsect3">
<a name="g-ascii-ispunct.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>c</p></td>
<td class="parameter_description"><p>any character</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-ispunct.returns"></a><h4>Returns</h4>
<p> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>c</code></em>
is an ASCII punctuation character.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-isspace"></a><h3>g_ascii_isspace ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
g_ascii_isspace (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> c</code></em>);</pre>
<p>Determines whether a character is a white-space character.</p>
<p>Unlike the standard C library <code class="function">isspace()</code> function, this only
recognizes standard ASCII white-space and ignores the locale,
returning <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a> for all non-ASCII characters. Also, unlike
the standard library function, this takes a char, not an int,
so don't call it on <code class="literal">EOF</code>, but no need to cast to <a class="link" href="glib-Basic-Types.html#guchar" title="guchar"><span class="type">guchar</span></a> before
passing a possibly non-ASCII character in.</p>
<div class="refsect3">
<a name="g-ascii-isspace.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>c</p></td>
<td class="parameter_description"><p>any character</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-isspace.returns"></a><h4>Returns</h4>
<p> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>c</code></em>
is an ASCII white-space character</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-isupper"></a><h3>g_ascii_isupper ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
g_ascii_isupper (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> c</code></em>);</pre>
<p>Determines whether a character is an ASCII upper case letter.</p>
<p>Unlike the standard C library <code class="function">isupper()</code> function, this only
recognizes standard ASCII letters and ignores the locale,
returning <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a> for all non-ASCII characters. Also, unlike
the standard library function, this takes a char, not an int,
so don't call it on <code class="literal">EOF</code>, but no need to worry about casting
to <a class="link" href="glib-Basic-Types.html#guchar" title="guchar"><span class="type">guchar</span></a> before passing a possibly non-ASCII character in.</p>
<div class="refsect3">
<a name="g-ascii-isupper.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>c</p></td>
<td class="parameter_description"><p>any character</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-isupper.returns"></a><h4>Returns</h4>
<p> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>c</code></em>
is an ASCII upper case letter</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-isxdigit"></a><h3>g_ascii_isxdigit ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
g_ascii_isxdigit (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> c</code></em>);</pre>
<p>Determines whether a character is a hexadecimal-digit character.</p>
<p>Unlike the standard C library <code class="function">isxdigit()</code> function, this takes
a char, not an int, so don't call it on <code class="literal">EOF</code>, but no need to
cast to <a class="link" href="glib-Basic-Types.html#guchar" title="guchar"><span class="type">guchar</span></a> before passing a possibly non-ASCII character in.</p>
<div class="refsect3">
<a name="g-ascii-isxdigit.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>c</p></td>
<td class="parameter_description"><p>any character</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-isxdigit.returns"></a><h4>Returns</h4>
<p> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>c</code></em>
is an ASCII hexadecimal-digit character.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-digit-value"></a><h3>g_ascii_digit_value ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
g_ascii_digit_value (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> c</code></em>);</pre>
<p>Determines the numeric value of a character as a decimal digit.
Differs from <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-digit-value" title="g_unichar_digit_value ()"><code class="function">g_unichar_digit_value()</code></a> because it takes a char, so
there's no worry about sign extension if characters are signed.</p>
<div class="refsect3">
<a name="g-ascii-digit-value.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>c</p></td>
<td class="parameter_description"><p>an ASCII character</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-digit-value.returns"></a><h4>Returns</h4>
<p> If <em class="parameter"><code>c</code></em>
is a decimal digit (according to <a class="link" href="glib-String-Utility-Functions.html#g-ascii-isdigit" title="g_ascii_isdigit ()"><code class="function">g_ascii_isdigit()</code></a>),
its numeric value. Otherwise, -1.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-xdigit-value"></a><h3>g_ascii_xdigit_value ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
g_ascii_xdigit_value (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> c</code></em>);</pre>
<p>Determines the numeric value of a character as a hexidecimal
digit. Differs from <a class="link" href="glib-Unicode-Manipulation.html#g-unichar-xdigit-value" title="g_unichar_xdigit_value ()"><code class="function">g_unichar_xdigit_value()</code></a> because it takes
a char, so there's no worry about sign extension if characters
are signed.</p>
<div class="refsect3">
<a name="g-ascii-xdigit-value.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>c</p></td>
<td class="parameter_description"><p>an ASCII character.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-xdigit-value.returns"></a><h4>Returns</h4>
<p> If <em class="parameter"><code>c</code></em>
is a hex digit (according to <a class="link" href="glib-String-Utility-Functions.html#g-ascii-isxdigit" title="g_ascii_isxdigit ()"><code class="function">g_ascii_isxdigit()</code></a>),
its numeric value. Otherwise, -1.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-strcasecmp"></a><h3>g_ascii_strcasecmp ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
g_ascii_strcasecmp (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *s1</code></em>,
                    <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *s2</code></em>);</pre>
<p>Compare two strings, ignoring the case of ASCII characters.</p>
<p>Unlike the BSD <code class="function">strcasecmp()</code> function, this only recognizes standard
ASCII letters and ignores the locale, treating all non-ASCII
bytes as if they are not letters.</p>
<p>This function should be used only on strings that are known to be
in encodings where the bytes corresponding to ASCII letters always
represent themselves. This includes UTF-8 and the ISO-8859-*
charsets, but not for instance double-byte encodings like the
Windows Codepage 932, where the trailing bytes of double-byte
characters include all ASCII letters. If you compare two CP932
strings using this function, you will get false matches.</p>
<p>Both <em class="parameter"><code>s1</code></em>
 and <em class="parameter"><code>s2</code></em>
 must be non-<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>.</p>
<div class="refsect3">
<a name="g-ascii-strcasecmp.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>s1</p></td>
<td class="parameter_description"><p>string to compare with <em class="parameter"><code>s2</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>s2</p></td>
<td class="parameter_description"><p>string to compare with <em class="parameter"><code>s1</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-strcasecmp.returns"></a><h4>Returns</h4>
<p> 0 if the strings match, a negative value if <em class="parameter"><code>s1</code></em>
&lt; <em class="parameter"><code>s2</code></em>
,
or a positive value if <em class="parameter"><code>s1</code></em>
&gt; <em class="parameter"><code>s2</code></em>
.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-strncasecmp"></a><h3>g_ascii_strncasecmp ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
g_ascii_strncasecmp (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *s1</code></em>,
                     <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *s2</code></em>,
                     <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gsize" title="gsize"><span class="type">gsize</span></a> n</code></em>);</pre>
<p>Compare <em class="parameter"><code>s1</code></em>
 and <em class="parameter"><code>s2</code></em>
, ignoring the case of ASCII characters and any
characters after the first <em class="parameter"><code>n</code></em>
 in each string.</p>
<p>Unlike the BSD <code class="function">strcasecmp()</code> function, this only recognizes standard
ASCII letters and ignores the locale, treating all non-ASCII
characters as if they are not letters.</p>
<p>The same warning as in <a class="link" href="glib-String-Utility-Functions.html#g-ascii-strcasecmp" title="g_ascii_strcasecmp ()"><code class="function">g_ascii_strcasecmp()</code></a> applies: Use this
function only on strings known to be in encodings where bytes
corresponding to ASCII letters always represent themselves.</p>
<div class="refsect3">
<a name="g-ascii-strncasecmp.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>s1</p></td>
<td class="parameter_description"><p>string to compare with <em class="parameter"><code>s2</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>s2</p></td>
<td class="parameter_description"><p>string to compare with <em class="parameter"><code>s1</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>n</p></td>
<td class="parameter_description"><p>number of characters to compare</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-strncasecmp.returns"></a><h4>Returns</h4>
<p> 0 if the strings match, a negative value if <em class="parameter"><code>s1</code></em>
&lt; <em class="parameter"><code>s2</code></em>
,
or a positive value if <em class="parameter"><code>s1</code></em>
&gt; <em class="parameter"><code>s2</code></em>
.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-strup"></a><h3>g_ascii_strup ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_ascii_strup (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>,
               <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> len</code></em>);</pre>
<p>Converts all lower case ASCII letters to upper case ASCII letters.</p>
<div class="refsect3">
<a name="g-ascii-strup.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>str</p></td>
<td class="parameter_description"><p>a string</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>len</p></td>
<td class="parameter_description"><p>length of <em class="parameter"><code>str</code></em>
in bytes, or -1 if <em class="parameter"><code>str</code></em>
is nul-terminated</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-strup.returns"></a><h4>Returns</h4>
<p> a newly allocated string, with all the lower case
characters in <em class="parameter"><code>str</code></em>
converted to upper case, with semantics that
exactly match <a class="link" href="glib-String-Utility-Functions.html#g-ascii-toupper" title="g_ascii_toupper ()"><code class="function">g_ascii_toupper()</code></a>. (Note that this is unlike the
old <a class="link" href="glib-String-Utility-Functions.html#g-strup" title="g_strup ()"><code class="function">g_strup()</code></a>, which modified the string in place.)</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-strdown"></a><h3>g_ascii_strdown ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_ascii_strdown (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>,
                 <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a> len</code></em>);</pre>
<p>Converts all upper case ASCII letters to lower case ASCII letters.</p>
<div class="refsect3">
<a name="g-ascii-strdown.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>str</p></td>
<td class="parameter_description"><p>a string</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>len</p></td>
<td class="parameter_description"><p>length of <em class="parameter"><code>str</code></em>
in bytes, or -1 if <em class="parameter"><code>str</code></em>
is nul-terminated</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-strdown.returns"></a><h4>Returns</h4>
<p> a newly-allocated string, with all the upper case
characters in <em class="parameter"><code>str</code></em>
converted to lower case, with semantics that
exactly match <a class="link" href="glib-String-Utility-Functions.html#g-ascii-tolower" title="g_ascii_tolower ()"><code class="function">g_ascii_tolower()</code></a>. (Note that this is unlike the
old <a class="link" href="glib-String-Utility-Functions.html#g-strdown" title="g_strdown ()"><code class="function">g_strdown()</code></a>, which modified the string in place.)</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-tolower"></a><h3>g_ascii_tolower ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>
g_ascii_tolower (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> c</code></em>);</pre>
<p>Convert a character to ASCII lower case.</p>
<p>Unlike the standard C library <code class="function">tolower()</code> function, this only
recognizes standard ASCII letters and ignores the locale, returning
all non-ASCII characters unchanged, even if they are lower case
letters in a particular character set. Also unlike the standard
library function, this takes and returns a char, not an int, so
don't call it on <code class="literal">EOF</code> but no need to worry about casting to <a class="link" href="glib-Basic-Types.html#guchar" title="guchar"><span class="type">guchar</span></a>
before passing a possibly non-ASCII character in.</p>
<div class="refsect3">
<a name="g-ascii-tolower.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>c</p></td>
<td class="parameter_description"><p>any character</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-tolower.returns"></a><h4>Returns</h4>
<p> the result of converting <em class="parameter"><code>c</code></em>
to lower case. If <em class="parameter"><code>c</code></em>
is
not an ASCII upper case letter, <em class="parameter"><code>c</code></em>
is returned unchanged.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-toupper"></a><h3>g_ascii_toupper ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a>
g_ascii_toupper (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> c</code></em>);</pre>
<p>Convert a character to ASCII upper case.</p>
<p>Unlike the standard C library <code class="function">toupper()</code> function, this only
recognizes standard ASCII letters and ignores the locale, returning
all non-ASCII characters unchanged, even if they are upper case
letters in a particular character set. Also unlike the standard
library function, this takes and returns a char, not an int, so
don't call it on <code class="literal">EOF</code> but no need to worry about casting to <a class="link" href="glib-Basic-Types.html#guchar" title="guchar"><span class="type">guchar</span></a>
before passing a possibly non-ASCII character in.</p>
<div class="refsect3">
<a name="g-ascii-toupper.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>c</p></td>
<td class="parameter_description"><p>any character</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-toupper.returns"></a><h4>Returns</h4>
<p> the result of converting <em class="parameter"><code>c</code></em>
to upper case. If <em class="parameter"><code>c</code></em>
is not
an ASCII lower case letter, <em class="parameter"><code>c</code></em>
is returned unchanged.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-string-ascii-up"></a><h3>g_string_ascii_up ()</h3>
<pre class="programlisting"><a class="link" href="glib-Strings.html#GString" title="struct GString"><span class="returnvalue">GString</span></a> *
g_string_ascii_up (<em class="parameter"><code><a class="link" href="glib-Strings.html#GString" title="struct GString"><span class="type">GString</span></a> *string</code></em>);</pre>
<p>Converts all lowercase ASCII letters to uppercase ASCII letters.</p>
<div class="refsect3">
<a name="g-string-ascii-up.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description"><p>a GString</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-string-ascii-up.returns"></a><h4>Returns</h4>
<p>passed-in <em class="parameter"><code>string</code></em>
pointer, with all the
lowercase characters converted to uppercase in place,
with semantics that exactly match <a class="link" href="glib-String-Utility-Functions.html#g-ascii-toupper" title="g_ascii_toupper ()"><code class="function">g_ascii_toupper()</code></a>. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-string-ascii-down"></a><h3>g_string_ascii_down ()</h3>
<pre class="programlisting"><a class="link" href="glib-Strings.html#GString" title="struct GString"><span class="returnvalue">GString</span></a> *
g_string_ascii_down (<em class="parameter"><code><a class="link" href="glib-Strings.html#GString" title="struct GString"><span class="type">GString</span></a> *string</code></em>);</pre>
<p>Converts all uppercase ASCII letters to lowercase ASCII letters.</p>
<div class="refsect3">
<a name="g-string-ascii-down.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description"><p>a GString</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-string-ascii-down.returns"></a><h4>Returns</h4>
<p>passed-in <em class="parameter"><code>string</code></em>
pointer, with all the
uppercase characters converted to lowercase in place,
with semantics that exactly match <a class="link" href="glib-String-Utility-Functions.html#g-ascii-tolower" title="g_ascii_tolower ()"><code class="function">g_ascii_tolower()</code></a>. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strup"></a><h3>g_strup ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_strup (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>);</pre>
<div class="warning">
<p><code class="literal">g_strup</code> has been deprecated since version 2.2 and should not be used in newly-written code.</p>
<p>This function is totally broken for the reasons
    discussed in the <a class="link" href="glib-String-Utility-Functions.html#g-strncasecmp" title="g_strncasecmp ()"><code class="function">g_strncasecmp()</code></a> docs - use <a class="link" href="glib-String-Utility-Functions.html#g-ascii-strup" title="g_ascii_strup ()"><code class="function">g_ascii_strup()</code></a>
    or <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-strup" title="g_utf8_strup ()"><code class="function">g_utf8_strup()</code></a> instead.</p>
</div>
<p>Converts a string to upper case.</p>
<div class="refsect3">
<a name="g-strup.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description"><p>the string to convert</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strup.returns"></a><h4>Returns</h4>
<p> the string</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strdown"></a><h3>g_strdown ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_strdown (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>);</pre>
<div class="warning">
<p><code class="literal">g_strdown</code> has been deprecated since version 2.2 and should not be used in newly-written code.</p>
<p>This function is totally broken for the reasons discussed
in the <a class="link" href="glib-String-Utility-Functions.html#g-strncasecmp" title="g_strncasecmp ()"><code class="function">g_strncasecmp()</code></a> docs - use <a class="link" href="glib-String-Utility-Functions.html#g-ascii-strdown" title="g_ascii_strdown ()"><code class="function">g_ascii_strdown()</code></a> or <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-strdown" title="g_utf8_strdown ()"><code class="function">g_utf8_strdown()</code></a>
instead.</p>
</div>
<p>Converts a string to lower case.</p>
<div class="refsect3">
<a name="g-strdown.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description"><p>the string to convert.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strdown.returns"></a><h4>Returns</h4>
<p> the string</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strcasecmp"></a><h3>g_strcasecmp ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
g_strcasecmp (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *s1</code></em>,
              <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *s2</code></em>);</pre>
<div class="warning">
<p><code class="literal">g_strcasecmp</code> has been deprecated since version 2.2 and should not be used in newly-written code.</p>
<p>See <a class="link" href="glib-String-Utility-Functions.html#g-strncasecmp" title="g_strncasecmp ()"><code class="function">g_strncasecmp()</code></a> for a discussion of why this
    function is deprecated and how to replace it.</p>
</div>
<p>A case-insensitive string comparison, corresponding to the standard
<code class="function">strcasecmp()</code> function on platforms which support it.</p>
<div class="refsect3">
<a name="g-strcasecmp.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>s1</p></td>
<td class="parameter_description"><p>a string</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>s2</p></td>
<td class="parameter_description"><p>a string to compare with <em class="parameter"><code>s1</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strcasecmp.returns"></a><h4>Returns</h4>
<p> 0 if the strings match, a negative value if <em class="parameter"><code>s1</code></em>
&lt; <em class="parameter"><code>s2</code></em>
,
or a positive value if <em class="parameter"><code>s1</code></em>
&gt; <em class="parameter"><code>s2</code></em>
.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strncasecmp"></a><h3>g_strncasecmp ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="returnvalue">gint</span></a>
g_strncasecmp (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *s1</code></em>,
               <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *s2</code></em>,
               <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint" title="guint ()"><span class="type">guint</span></a> n</code></em>);</pre>
<div class="warning">
<p><code class="literal">g_strncasecmp</code> has been deprecated since version 2.2 and should not be used in newly-written code.</p>
<p>The problem with <a class="link" href="glib-String-Utility-Functions.html#g-strncasecmp" title="g_strncasecmp ()"><code class="function">g_strncasecmp()</code></a> is that it does
    the comparison by calling <code class="function">toupper()</code>/<code class="function">tolower()</code>. These functions
    are locale-specific and operate on single bytes. However, it is
    impossible to handle things correctly from an internationalization
    standpoint by operating on bytes, since characters may be multibyte.
    Thus <a class="link" href="glib-String-Utility-Functions.html#g-strncasecmp" title="g_strncasecmp ()"><code class="function">g_strncasecmp()</code></a> is broken if your string is guaranteed to be
    ASCII, since it is locale-sensitive, and it's broken if your string
    is localized, since it doesn't work on many encodings at all,
    including UTF-8, EUC-JP, etc.</p>
<p>    There are therefore two replacement techniques: <a class="link" href="glib-String-Utility-Functions.html#g-ascii-strncasecmp" title="g_ascii_strncasecmp ()"><code class="function">g_ascii_strncasecmp()</code></a>,
    which only works on ASCII and is not locale-sensitive, and
    <a class="link" href="glib-Unicode-Manipulation.html#g-utf8-casefold" title="g_utf8_casefold ()"><code class="function">g_utf8_casefold()</code></a> followed by <code class="function">strcmp()</code> on the resulting strings,
    which is good for case-insensitive sorting of UTF-8.</p>
</div>
<p>A case-insensitive string comparison, corresponding to the standard
<code class="function">strncasecmp()</code> function on platforms which support it. It is similar
to <a class="link" href="glib-String-Utility-Functions.html#g-strcasecmp" title="g_strcasecmp ()"><code class="function">g_strcasecmp()</code></a> except it only compares the first <em class="parameter"><code>n</code></em>
 characters of
the strings.</p>
<div class="refsect3">
<a name="g-strncasecmp.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>s1</p></td>
<td class="parameter_description"><p>a string</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>s2</p></td>
<td class="parameter_description"><p>a string to compare with <em class="parameter"><code>s1</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>n</p></td>
<td class="parameter_description"><p>the maximum number of characters to compare</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strncasecmp.returns"></a><h4>Returns</h4>
<p> 0 if the strings match, a negative value if <em class="parameter"><code>s1</code></em>
&lt; <em class="parameter"><code>s2</code></em>
,
or a positive value if <em class="parameter"><code>s1</code></em>
&gt; <em class="parameter"><code>s2</code></em>
.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strreverse"></a><h3>g_strreverse ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_strreverse (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>);</pre>
<p>Reverses all of the bytes in a string. For example,
<code class="literal">g_strreverse ("abcdef")</code> will result in "fedcba".</p>
<p>Note that <a class="link" href="glib-String-Utility-Functions.html#g-strreverse" title="g_strreverse ()"><code class="function">g_strreverse()</code></a> doesn't work on UTF-8 strings
containing multibyte characters. For that purpose, use
<a class="link" href="glib-Unicode-Manipulation.html#g-utf8-strreverse" title="g_utf8_strreverse ()"><code class="function">g_utf8_strreverse()</code></a>.</p>
<div class="refsect3">
<a name="g-strreverse.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description"><p>the string to reverse</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strreverse.returns"></a><h4>Returns</h4>
<p> the same pointer passed in as <em class="parameter"><code>string</code></em>
</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-strtoll"></a><h3>g_ascii_strtoll ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint64" title="gint64"><span class="returnvalue">gint64</span></a>
g_ascii_strtoll (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *nptr</code></em>,
                 <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> **endptr</code></em>,
                 <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint" title="guint ()"><span class="type">guint</span></a> base</code></em>);</pre>
<p>Converts a string to a <a class="link" href="glib-Basic-Types.html#gint64" title="gint64"><span class="type">gint64</span></a> value.
This function behaves like the standard <code class="function">strtoll()</code> function
does in the C locale. It does this without actually
changing the current locale, since that would not be
thread-safe.</p>
<p>This function is typically used when reading configuration
files or other non-user input that should be locale independent.
To handle input from the user you should normally use the
locale-sensitive system <code class="function">strtoll()</code> function.</p>
<p>If the correct value would cause overflow, <a class="link" href="glib-Basic-Types.html#G-MAXINT64:CAPS" title="G_MAXINT64"><code class="literal">G_MAXINT64</code></a> or <a class="link" href="glib-Basic-Types.html#G-MININT64:CAPS" title="G_MININT64"><code class="literal">G_MININT64</code></a>
is returned, and <code class="literal">ERANGE</code> is stored in <code class="literal">errno</code>.
If the base is outside the valid range, zero is returned, and
<code class="literal">EINVAL</code> is stored in <code class="literal">errno</code>. If the
string conversion fails, zero is returned, and <em class="parameter"><code>endptr</code></em>
 returns <em class="parameter"><code>nptr</code></em>

(if <em class="parameter"><code>endptr</code></em>
 is non-<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>).</p>
<div class="refsect3">
<a name="g-ascii-strtoll.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>nptr</p></td>
<td class="parameter_description"><p>the string to convert to a numeric value.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>endptr</p></td>
<td class="parameter_description"><p>if non-<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>, it returns the
character after the last character used in the conversion. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>base</p></td>
<td class="parameter_description"><p>to be used for the conversion, 2..36 or 0</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-strtoll.returns"></a><h4>Returns</h4>
<p> the <a class="link" href="glib-Basic-Types.html#gint64" title="gint64"><span class="type">gint64</span></a> value or zero on error.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-12.html#api-index-2.12">2.12</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-strtoull"></a><h3>g_ascii_strtoull ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#guint64" title="guint64"><span class="returnvalue">guint64</span></a>
g_ascii_strtoull (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *nptr</code></em>,
                  <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> **endptr</code></em>,
                  <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint" title="guint ()"><span class="type">guint</span></a> base</code></em>);</pre>
<p>Converts a string to a <a class="link" href="glib-Basic-Types.html#guint64" title="guint64"><span class="type">guint64</span></a> value.
This function behaves like the standard <code class="function">strtoull()</code> function
does in the C locale. It does this without actually
changing the current locale, since that would not be
thread-safe.</p>
<p>This function is typically used when reading configuration
files or other non-user input that should be locale independent.
To handle input from the user you should normally use the
locale-sensitive system <code class="function">strtoull()</code> function.</p>
<p>If the correct value would cause overflow, <a class="link" href="glib-Basic-Types.html#G-MAXUINT64:CAPS" title="G_MAXUINT64"><code class="literal">G_MAXUINT64</code></a>
is returned, and <code class="literal">ERANGE</code> is stored in <code class="literal">errno</code>.
If the base is outside the valid range, zero is returned, and
<code class="literal">EINVAL</code> is stored in <code class="literal">errno</code>.
If the string conversion fails, zero is returned, and <em class="parameter"><code>endptr</code></em>
 returns
<em class="parameter"><code>nptr</code></em>
 (if <em class="parameter"><code>endptr</code></em>
 is non-<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>).</p>
<div class="refsect3">
<a name="g-ascii-strtoull.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>nptr</p></td>
<td class="parameter_description"><p>the string to convert to a numeric value.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>endptr</p></td>
<td class="parameter_description"><p>if non-<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>, it returns the
character after the last character used in the conversion. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>base</p></td>
<td class="parameter_description"><p>to be used for the conversion, 2..36 or 0</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-strtoull.returns"></a><h4>Returns</h4>
<p> the <a class="link" href="glib-Basic-Types.html#guint64" title="guint64"><span class="type">guint64</span></a> value or zero on error.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-2.html#api-index-2.2">2.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-strtod"></a><h3>g_ascii_strtod ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gdouble" title="gdouble"><span class="returnvalue">gdouble</span></a>
g_ascii_strtod (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *nptr</code></em>,
                <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> **endptr</code></em>);</pre>
<p>Converts a string to a <a class="link" href="glib-Basic-Types.html#gdouble" title="gdouble"><span class="type">gdouble</span></a> value.</p>
<p>This function behaves like the standard <code class="function">strtod()</code> function
does in the C locale. It does this without actually changing
the current locale, since that would not be thread-safe.
A limitation of the implementation is that this function
will still accept localized versions of infinities and NANs.</p>
<p>This function is typically used when reading configuration
files or other non-user input that should be locale independent.
To handle input from the user you should normally use the
locale-sensitive system <code class="function">strtod()</code> function.</p>
<p>To convert from a <a class="link" href="glib-Basic-Types.html#gdouble" title="gdouble"><span class="type">gdouble</span></a> to a string in a locale-insensitive
way, use <a class="link" href="glib-String-Utility-Functions.html#g-ascii-dtostr" title="g_ascii_dtostr ()"><code class="function">g_ascii_dtostr()</code></a>.</p>
<p>If the correct value would cause overflow, plus or minus <code class="literal">HUGE_VAL</code>
is returned (according to the sign of the value), and <code class="literal">ERANGE</code> is
stored in <code class="literal">errno</code>. If the correct value would cause underflow,
zero is returned and <code class="literal">ERANGE</code> is stored in <code class="literal">errno</code>.</p>
<p>This function resets <code class="literal">errno</code> before calling <code class="function">strtod()</code> so that
you can reliably detect overflow and underflow.</p>
<div class="refsect3">
<a name="g-ascii-strtod.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>nptr</p></td>
<td class="parameter_description"><p>the string to convert to a numeric value.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>endptr</p></td>
<td class="parameter_description"><p>if non-<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>, it returns the
character after the last character used in the conversion. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-strtod.returns"></a><h4>Returns</h4>
<p> the <a class="link" href="glib-Basic-Types.html#gdouble" title="gdouble"><span class="type">gdouble</span></a> value.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-dtostr"></a><h3>g_ascii_dtostr ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_ascii_dtostr (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *buffer</code></em>,
                <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="type">gint</span></a> buf_len</code></em>,
                <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gdouble" title="gdouble"><span class="type">gdouble</span></a> d</code></em>);</pre>
<p>Converts a <a class="link" href="glib-Basic-Types.html#gdouble" title="gdouble"><span class="type">gdouble</span></a> to a string, using the '.' as
decimal point.</p>
<p>This function generates enough precision that converting
the string back using <a class="link" href="glib-String-Utility-Functions.html#g-ascii-strtod" title="g_ascii_strtod ()"><code class="function">g_ascii_strtod()</code></a> gives the same machine-number
(on machines with IEEE compatible 64bit doubles). It is
guaranteed that the size of the resulting string will never
be larger than <em class="parameter"><code>G_ASCII_DTOSTR_BUF_SIZE</code></em>
 bytes, including the terminating
nul character, which is always added.</p>
<div class="refsect3">
<a name="g-ascii-dtostr.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>buffer</p></td>
<td class="parameter_description"><p>A buffer to place the resulting string in</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>buf_len</p></td>
<td class="parameter_description"><p>The length of the buffer.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>d</p></td>
<td class="parameter_description"><p>The <a class="link" href="glib-Basic-Types.html#gdouble" title="gdouble"><span class="type">gdouble</span></a> to convert</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-dtostr.returns"></a><h4>Returns</h4>
<p> The pointer to the buffer with the converted string.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-formatd"></a><h3>g_ascii_formatd ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_ascii_formatd (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *buffer</code></em>,
                 <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="type">gint</span></a> buf_len</code></em>,
                 <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *format</code></em>,
                 <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gdouble" title="gdouble"><span class="type">gdouble</span></a> d</code></em>);</pre>
<p>Converts a <a class="link" href="glib-Basic-Types.html#gdouble" title="gdouble"><span class="type">gdouble</span></a> to a string, using the '.' as
decimal point. To format the number you pass in
a <code class="function">printf()</code>-style format string. Allowed conversion
specifiers are 'e', 'E', 'f', 'F', 'g' and 'G'.</p>
<p>The returned buffer is guaranteed to be nul-terminated.</p>
<p>If you just want to want to serialize the value into a
string, use <a class="link" href="glib-String-Utility-Functions.html#g-ascii-dtostr" title="g_ascii_dtostr ()"><code class="function">g_ascii_dtostr()</code></a>.</p>
<div class="refsect3">
<a name="g-ascii-formatd.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>buffer</p></td>
<td class="parameter_description"><p>A buffer to place the resulting string in</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>buf_len</p></td>
<td class="parameter_description"><p>The length of the buffer.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>The <code class="function">printf()</code>-style format to use for the
code to use for converting.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>d</p></td>
<td class="parameter_description"><p>The <a class="link" href="glib-Basic-Types.html#gdouble" title="gdouble"><span class="type">gdouble</span></a> to convert</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-formatd.returns"></a><h4>Returns</h4>
<p> The pointer to the buffer with the converted string.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strtod"></a><h3>g_strtod ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gdouble" title="gdouble"><span class="returnvalue">gdouble</span></a>
g_strtod (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *nptr</code></em>,
          <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> **endptr</code></em>);</pre>
<p>Converts a string to a <a class="link" href="glib-Basic-Types.html#gdouble" title="gdouble"><span class="type">gdouble</span></a> value.
It calls the standard <code class="function">strtod()</code> function to handle the conversion, but
if the string is not completely converted it attempts the conversion
again with <a class="link" href="glib-String-Utility-Functions.html#g-ascii-strtod" title="g_ascii_strtod ()"><code class="function">g_ascii_strtod()</code></a>, and returns the best match.</p>
<p>This function should seldom be used. The normal situation when reading
numbers not for human consumption is to use <a class="link" href="glib-String-Utility-Functions.html#g-ascii-strtod" title="g_ascii_strtod ()"><code class="function">g_ascii_strtod()</code></a>. Only when
you know that you must expect both locale formatted and C formatted numbers
should you use this. Make sure that you don't pass strings such as comma
separated lists of values, since the commas may be interpreted as a decimal
point in some locales, causing unexpected results.</p>
<div class="refsect3">
<a name="g-strtod.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>nptr</p></td>
<td class="parameter_description"><p>the string to convert to a numeric value.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>endptr</p></td>
<td class="parameter_description"><p>if non-<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>, it returns the
character after the last character used in the conversion. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strtod.returns"></a><h4>Returns</h4>
<p> the <a class="link" href="glib-Basic-Types.html#gdouble" title="gdouble"><span class="type">gdouble</span></a> value.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-string-to-signed"></a><h3>g_ascii_string_to_signed ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
g_ascii_string_to_signed (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>,
                          <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint" title="guint ()"><span class="type">guint</span></a> base</code></em>,
                          <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint64" title="gint64"><span class="type">gint64</span></a> min</code></em>,
                          <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint64" title="gint64"><span class="type">gint64</span></a> max</code></em>,
                          <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint64" title="gint64"><span class="type">gint64</span></a> *out_num</code></em>,
                          <em class="parameter"><code><a class="link" href="glib-Error-Reporting.html#GError" title="struct GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>A convenience function for converting a string to a signed number.</p>
<p>This function assumes that <em class="parameter"><code>str</code></em>
 contains only a number of the given
<em class="parameter"><code>base</code></em>
 that is within inclusive bounds limited by <em class="parameter"><code>min</code></em>
 and <em class="parameter"><code>max</code></em>
. If
this is true, then the converted number is stored in <em class="parameter"><code>out_num</code></em>
. An
empty string is not a valid input. A string with leading or
trailing whitespace is also an invalid input.</p>
<p><em class="parameter"><code>base</code></em>
 can be between 2 and 36 inclusive. Hexadecimal numbers must
not be prefixed with "0x" or "0X". Such a problem does not exist
for octal numbers, since they were usually prefixed with a zero
which does not change the value of the parsed number.</p>
<p>Parsing failures result in an error with the <a class="link" href="glib-String-Utility-Functions.html#G-NUMBER-PARSER-ERROR:CAPS" title="G_NUMBER_PARSER_ERROR"><code class="literal">G_NUMBER_PARSER_ERROR</code></a>
domain. If the input is invalid, the error code will be
<a class="link" href="glib-String-Utility-Functions.html#G-NUMBER-PARSER-ERROR-INVALID:CAPS"><code class="literal">G_NUMBER_PARSER_ERROR_INVALID</code></a>. If the parsed number is out of
bounds - <a class="link" href="glib-String-Utility-Functions.html#G-NUMBER-PARSER-ERROR-OUT-OF-BOUNDS:CAPS"><code class="literal">G_NUMBER_PARSER_ERROR_OUT_OF_BOUNDS</code></a>.</p>
<p>See <a class="link" href="glib-String-Utility-Functions.html#g-ascii-strtoll" title="g_ascii_strtoll ()"><code class="function">g_ascii_strtoll()</code></a> if you have more complex needs such as
parsing a string which starts with a number, but then has other
characters.</p>
<div class="refsect3">
<a name="g-ascii-string-to-signed.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>str</p></td>
<td class="parameter_description"><p>a string</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>base</p></td>
<td class="parameter_description"><p>base of a parsed number</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>min</p></td>
<td class="parameter_description"><p>a lower bound (inclusive)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>max</p></td>
<td class="parameter_description"><p>an upper bound (inclusive)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>out_num</p></td>
<td class="parameter_description"><p>a return location for a number. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>a return location for <a class="link" href="glib-Error-Reporting.html#GError" title="struct GError"><span class="type">GError</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-string-to-signed.returns"></a><h4>Returns</h4>
<p> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>str</code></em>
was a number, otherwise <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a>.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-54.html#api-index-2.54">2.54</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-ascii-string-to-unsigned"></a><h3>g_ascii_string_to_unsigned ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
g_ascii_string_to_unsigned (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>,
                            <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint" title="guint ()"><span class="type">guint</span></a> base</code></em>,
                            <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint64" title="guint64"><span class="type">guint64</span></a> min</code></em>,
                            <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint64" title="guint64"><span class="type">guint64</span></a> max</code></em>,
                            <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint64" title="guint64"><span class="type">guint64</span></a> *out_num</code></em>,
                            <em class="parameter"><code><a class="link" href="glib-Error-Reporting.html#GError" title="struct GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>A convenience function for converting a string to an unsigned number.</p>
<p>This function assumes that <em class="parameter"><code>str</code></em>
 contains only a number of the given
<em class="parameter"><code>base</code></em>
 that is within inclusive bounds limited by <em class="parameter"><code>min</code></em>
 and <em class="parameter"><code>max</code></em>
. If
this is true, then the converted number is stored in <em class="parameter"><code>out_num</code></em>
. An
empty string is not a valid input. A string with leading or
trailing whitespace is also an invalid input.</p>
<p><em class="parameter"><code>base</code></em>
 can be between 2 and 36 inclusive. Hexadecimal numbers must
not be prefixed with "0x" or "0X". Such a problem does not exist
for octal numbers, since they were usually prefixed with a zero
which does not change the value of the parsed number.</p>
<p>Parsing failures result in an error with the <a class="link" href="glib-String-Utility-Functions.html#G-NUMBER-PARSER-ERROR:CAPS" title="G_NUMBER_PARSER_ERROR"><code class="literal">G_NUMBER_PARSER_ERROR</code></a>
domain. If the input is invalid, the error code will be
<a class="link" href="glib-String-Utility-Functions.html#G-NUMBER-PARSER-ERROR-INVALID:CAPS"><code class="literal">G_NUMBER_PARSER_ERROR_INVALID</code></a>. If the parsed number is out of
bounds - <a class="link" href="glib-String-Utility-Functions.html#G-NUMBER-PARSER-ERROR-OUT-OF-BOUNDS:CAPS"><code class="literal">G_NUMBER_PARSER_ERROR_OUT_OF_BOUNDS</code></a>.</p>
<p>See <a class="link" href="glib-String-Utility-Functions.html#g-ascii-strtoull" title="g_ascii_strtoull ()"><code class="function">g_ascii_strtoull()</code></a> if you have more complex needs such as
parsing a string which starts with a number, but then has other
characters.</p>
<div class="refsect3">
<a name="g-ascii-string-to-unsigned.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>str</p></td>
<td class="parameter_description"><p>a string</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>base</p></td>
<td class="parameter_description"><p>base of a parsed number</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>min</p></td>
<td class="parameter_description"><p>a lower bound (inclusive)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>max</p></td>
<td class="parameter_description"><p>an upper bound (inclusive)</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>out_num</p></td>
<td class="parameter_description"><p>a return location for a number. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>a return location for <a class="link" href="glib-Error-Reporting.html#GError" title="struct GError"><span class="type">GError</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-ascii-string-to-unsigned.returns"></a><h4>Returns</h4>
<p> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>str</code></em>
was a number, otherwise <a class="link" href="glib-Standard-Macros.html#FALSE:CAPS" title="FALSE"><code class="literal">FALSE</code></a>.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-54.html#api-index-2.54">2.54</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-strchug"></a><h3>g_strchug ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_strchug (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>);</pre>
<p>Removes leading whitespace from a string, by moving the rest
of the characters forward.</p>
<p>This function doesn't allocate or reallocate any memory;
it modifies <em class="parameter"><code>string</code></em>
 in place. Therefore, it cannot be used on
statically allocated strings.</p>
<p>The pointer to <em class="parameter"><code>string</code></em>
 is returned to allow the nesting of functions.</p>
<p>Also see <a class="link" href="glib-String-Utility-Functions.html#g-strchomp" title="g_strchomp ()"><code class="function">g_strchomp()</code></a> and <a class="link" href="glib-String-Utility-Functions.html#g-strstrip" title="g_strstrip()"><code class="function">g_strstrip()</code></a>.</p>
<div class="refsect3">
<a name="g-strchug.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description"><p>a string to remove the leading whitespace from</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strchug.returns"></a><h4>Returns</h4>
<p> <em class="parameter"><code>string</code></em>
</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strchomp"></a><h3>g_strchomp ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_strchomp (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>);</pre>
<p>Removes trailing whitespace from a string.</p>
<p>This function doesn't allocate or reallocate any memory;
it modifies <em class="parameter"><code>string</code></em>
 in place. Therefore, it cannot be used
on statically allocated strings.</p>
<p>The pointer to <em class="parameter"><code>string</code></em>
 is returned to allow the nesting of functions.</p>
<p>Also see <a class="link" href="glib-String-Utility-Functions.html#g-strchug" title="g_strchug ()"><code class="function">g_strchug()</code></a> and <a class="link" href="glib-String-Utility-Functions.html#g-strstrip" title="g_strstrip()"><code class="function">g_strstrip()</code></a>.</p>
<div class="refsect3">
<a name="g-strchomp.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description"><p>a string to remove the trailing whitespace from</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strchomp.returns"></a><h4>Returns</h4>
<p> <em class="parameter"><code>string</code></em>
</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strstrip"></a><h3>g_strstrip()</h3>
<pre class="programlisting">#define             g_strstrip( string )</pre>
<p>Removes leading and trailing whitespace from a string.
See <a class="link" href="glib-String-Utility-Functions.html#g-strchomp" title="g_strchomp ()"><code class="function">g_strchomp()</code></a> and <a class="link" href="glib-String-Utility-Functions.html#g-strchug" title="g_strchug ()"><code class="function">g_strchug()</code></a>.</p>
<div class="refsect3">
<a name="g-strstrip.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description"><p>a string to remove the leading and trailing whitespace from</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strstrip.returns"></a><h4>Returns</h4>
<p> <em class="parameter"><code>string</code></em>
</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strdelimit"></a><h3>g_strdelimit ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_strdelimit (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>,
              <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *delimiters</code></em>,
              <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> new_delimiter</code></em>);</pre>
<p>Converts any delimiter characters in <em class="parameter"><code>string</code></em>
 to <em class="parameter"><code>new_delimiter</code></em>
.
Any characters in <em class="parameter"><code>string</code></em>
 which are found in <em class="parameter"><code>delimiters</code></em>
 are
changed to the <em class="parameter"><code>new_delimiter</code></em>
 character. Modifies <em class="parameter"><code>string</code></em>
 in place,
and returns <em class="parameter"><code>string</code></em>
 itself, not a copy. The return value is to
allow nesting such as</p>
<div class="informalexample">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="function"><a href="glib-String-Utility-Functions.html#g-ascii-strup">g_ascii_strup</a></span> <span class="gtkdoc opt">(</span><span class="function"><a href="glib-String-Utility-Functions.html#g-strdelimit">g_strdelimit</a></span> <span class="gtkdoc opt">(</span>str<span class="gtkdoc opt">,</span> <span class="string">&quot;abc&quot;</span><span class="gtkdoc opt">,</span> <span class="string">&apos;?&apos;</span><span class="gtkdoc opt">))</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

<p></p>
<div class="refsect3">
<a name="g-strdelimit.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description"><p>the string to convert</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>delimiters</p></td>
<td class="parameter_description"><p>a string containing the current delimiters,
or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> to use the standard delimiters defined in <a class="link" href="glib-String-Utility-Functions.html#G-STR-DELIMITERS:CAPS" title="G_STR_DELIMITERS"><span class="type">G_STR_DELIMITERS</span></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>new_delimiter</p></td>
<td class="parameter_description"><p>the new delimiter character</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strdelimit.returns"></a><h4>Returns</h4>
<p> <em class="parameter"><code>string</code></em>
</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strescape"></a><h3>g_strescape ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_strescape (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *source</code></em>,
             <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *exceptions</code></em>);</pre>
<p>Escapes the special characters '\b', '\f', '\n', '\r', '\t', '\v', '\'
and '"' in the string <em class="parameter"><code>source</code></em>
 by inserting a '\' before
them. Additionally all characters in the range 0x01-0x1F (everything
below SPACE) and in the range 0x7F-0xFF (all non-ASCII chars) are
replaced with a '\' followed by their octal representation.
Characters supplied in <em class="parameter"><code>exceptions</code></em>
 are not escaped.</p>
<p>g_strcompress() does the reverse conversion.</p>
<div class="refsect3">
<a name="g-strescape.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>source</p></td>
<td class="parameter_description"><p>a string to escape</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>exceptions</p></td>
<td class="parameter_description"><p>a string of characters not to escape in <em class="parameter"><code>source</code></em>
. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strescape.returns"></a><h4>Returns</h4>
<p> a newly-allocated copy of <em class="parameter"><code>source</code></em>
with certain
characters escaped. See above.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strcompress"></a><h3>g_strcompress ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_strcompress (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *source</code></em>);</pre>
<p>Replaces all escaped characters with their one byte equivalent.</p>
<p>This function does the reverse conversion of <a class="link" href="glib-String-Utility-Functions.html#g-strescape" title="g_strescape ()"><code class="function">g_strescape()</code></a>.</p>
<div class="refsect3">
<a name="g-strcompress.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>source</p></td>
<td class="parameter_description"><p>a string to compress</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strcompress.returns"></a><h4>Returns</h4>
<p> a newly-allocated copy of <em class="parameter"><code>source</code></em>
with all escaped
character compressed</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strcanon"></a><h3>g_strcanon ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_strcanon (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>,
            <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *valid_chars</code></em>,
            <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> substitutor</code></em>);</pre>
<p>For each character in <em class="parameter"><code>string</code></em>
, if the character is not in <em class="parameter"><code>valid_chars</code></em>
,
replaces the character with <em class="parameter"><code>substitutor</code></em>
. Modifies <em class="parameter"><code>string</code></em>
 in place,
and return <em class="parameter"><code>string</code></em>
 itself, not a copy. The return value is to allow
nesting such as</p>
<div class="informalexample">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="function"><a href="glib-String-Utility-Functions.html#g-ascii-strup">g_ascii_strup</a></span> <span class="gtkdoc opt">(</span><span class="function"><a href="glib-String-Utility-Functions.html#g-strcanon">g_strcanon</a></span> <span class="gtkdoc opt">(</span>str<span class="gtkdoc opt">,</span> <span class="string">&quot;abc&quot;</span><span class="gtkdoc opt">,</span> <span class="string">&apos;?&apos;</span><span class="gtkdoc opt">))</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

<p></p>
<div class="refsect3">
<a name="g-strcanon.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description"><p>a nul-terminated array of bytes</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>valid_chars</p></td>
<td class="parameter_description"><p>bytes permitted in <em class="parameter"><code>string</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>substitutor</p></td>
<td class="parameter_description"><p>replacement character for disallowed bytes</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strcanon.returns"></a><h4>Returns</h4>
<p> <em class="parameter"><code>string</code></em>
</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strsplit"></a><h3>g_strsplit ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **
g_strsplit (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>,
            <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *delimiter</code></em>,
            <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="type">gint</span></a> max_tokens</code></em>);</pre>
<p>Splits a string into a maximum of <em class="parameter"><code>max_tokens</code></em>
 pieces, using the given
<em class="parameter"><code>delimiter</code></em>
. If <em class="parameter"><code>max_tokens</code></em>
 is reached, the remainder of <em class="parameter"><code>string</code></em>
 is
appended to the last token.</p>
<p>As an example, the result of g_strsplit (":a:bc::d:", ":", -1) is a
<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated vector containing the six strings "", "a", "bc", "", "d"
and "".</p>
<p>As a special case, the result of splitting the empty string "" is an empty
vector, not a vector containing a single string. The reason for this
special case is that being able to represent a empty vector is typically
more useful than consistent handling of empty elements. If you do need
to represent empty elements, you'll need to check for the empty string
before calling <a class="link" href="glib-String-Utility-Functions.html#g-strsplit" title="g_strsplit ()"><code class="function">g_strsplit()</code></a>.</p>
<div class="refsect3">
<a name="g-strsplit.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description"><p>a string to split</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>delimiter</p></td>
<td class="parameter_description"><p>a string which specifies the places at which to split
the string. The delimiter is not included in any of the resulting
strings, unless <em class="parameter"><code>max_tokens</code></em>
is reached.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>max_tokens</p></td>
<td class="parameter_description"><p>the maximum number of pieces to split <em class="parameter"><code>string</code></em>
into.
If this is less than 1, the string is split completely.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strsplit.returns"></a><h4>Returns</h4>
<p> a newly-allocated <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated array of strings. Use
<a class="link" href="glib-String-Utility-Functions.html#g-strfreev" title="g_strfreev ()"><code class="function">g_strfreev()</code></a> to free it.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strsplit-set"></a><h3>g_strsplit_set ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> **
g_strsplit_set (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string</code></em>,
                <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *delimiters</code></em>,
                <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="type">gint</span></a> max_tokens</code></em>);</pre>
<p>Splits <em class="parameter"><code>string</code></em>
 into a number of tokens not containing any of the characters
in <em class="parameter"><code>delimiter</code></em>
. A token is the (possibly empty) longest string that does not
contain any of the characters in <em class="parameter"><code>delimiters</code></em>
. If <em class="parameter"><code>max_tokens</code></em>
 is reached, the
remainder is appended to the last token.</p>
<p>For example the result of g_strsplit_set ("abc:def/ghi", ":/", -1) is a
<a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated vector containing the three strings "abc", "def",
and "ghi".</p>
<p>The result of g_strsplit_set (":def/ghi:", ":/", -1) is a <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated
vector containing the four strings "", "def", "ghi", and "".</p>
<p>As a special case, the result of splitting the empty string "" is an empty
vector, not a vector containing a single string. The reason for this
special case is that being able to represent a empty vector is typically
more useful than consistent handling of empty elements. If you do need
to represent empty elements, you'll need to check for the empty string
before calling <a class="link" href="glib-String-Utility-Functions.html#g-strsplit-set" title="g_strsplit_set ()"><code class="function">g_strsplit_set()</code></a>.</p>
<p>Note that this function works on bytes not characters, so it can't be used
to delimit UTF-8 strings for anything but ASCII characters.</p>
<div class="refsect3">
<a name="g-strsplit-set.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description"><p>The string to be tokenized</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>delimiters</p></td>
<td class="parameter_description"><p>A nul-terminated string containing bytes that are used
to split the string.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>max_tokens</p></td>
<td class="parameter_description"><p>The maximum number of tokens to split <em class="parameter"><code>string</code></em>
into.
If this is less than 1, the string is split completely</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strsplit-set.returns"></a><h4>Returns</h4>
<p> a newly-allocated <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated array of strings. Use
<a class="link" href="glib-String-Utility-Functions.html#g-strfreev" title="g_strfreev ()"><code class="function">g_strfreev()</code></a> to free it.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-4.html#api-index-2.4">2.4</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-strfreev"></a><h3>g_strfreev ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
g_strfreev (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> **str_array</code></em>);</pre>
<p>Frees a <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated array of strings, as well as each
string it contains.</p>
<p>If <em class="parameter"><code>str_array</code></em>
 is <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>, this function simply returns.</p>
<div class="refsect3">
<a name="g-strfreev.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>str_array</p></td>
<td class="parameter_description"><p>a <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated array of strings to free. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strconcat"></a><h3>g_strconcat ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_strconcat (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *string1</code></em>,
             <em class="parameter"><code>...</code></em>);</pre>
<p>Concatenates all of the given strings into one long string. The
returned string should be freed with <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a> when no longer needed.</p>
<p>The variable argument list must end with <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. If you forget the <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>,
<a class="link" href="glib-String-Utility-Functions.html#g-strconcat" title="g_strconcat ()"><code class="function">g_strconcat()</code></a> will start appending random memory junk to your string.</p>
<p>Note that this function is usually not the right function to use to
assemble a translated message from pieces, since proper translation
often requires the pieces to be reordered.</p>
<div class="refsect3">
<a name="g-strconcat.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>string1</p></td>
<td class="parameter_description"><p>the first string to add, which must not be <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p>a <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated list of strings to append to the string</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strconcat.returns"></a><h4>Returns</h4>
<p> a newly-allocated string containing all the string arguments</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strjoin"></a><h3>g_strjoin ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_strjoin (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *separator</code></em>,
           <em class="parameter"><code>...</code></em>);</pre>
<p>Joins a number of strings together to form one long string, with the
optional <em class="parameter"><code>separator</code></em>
 inserted between each of them. The returned string
should be freed with <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a>.</p>
<div class="refsect3">
<a name="g-strjoin.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>separator</p></td>
<td class="parameter_description"><p>a string to insert between each of the
strings, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p>a <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated list of strings to join</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strjoin.returns"></a><h4>Returns</h4>
<p> a newly-allocated string containing all of the strings joined
together, with <em class="parameter"><code>separator</code></em>
between them</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strjoinv"></a><h3>g_strjoinv ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_strjoinv (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *separator</code></em>,
            <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> **str_array</code></em>);</pre>
<p>Joins a number of strings together to form one long string, with the
optional <em class="parameter"><code>separator</code></em>
 inserted between each of them. The returned string
should be freed with <a class="link" href="glib-Memory-Allocation.html#g-free" title="g_free ()"><code class="function">g_free()</code></a>.</p>
<p>If <em class="parameter"><code>str_array</code></em>
 has no items, the return value will be an
empty string. If <em class="parameter"><code>str_array</code></em>
 contains a single item, <em class="parameter"><code>separator</code></em>
 will not
appear in the resulting string.</p>
<div class="refsect3">
<a name="g-strjoinv.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>separator</p></td>
<td class="parameter_description"><p>a string to insert between each of the
strings, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>str_array</p></td>
<td class="parameter_description"><p>a <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated array of strings to join</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strjoinv.returns"></a><h4>Returns</h4>
<p> a newly-allocated string containing all of the strings joined
together, with <em class="parameter"><code>separator</code></em>
between them</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strv-length"></a><h3>g_strv_length ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#guint" title="guint ()"><span class="returnvalue">guint</span></a>
g_strv_length (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> **str_array</code></em>);</pre>
<p>Returns the length of the given <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated
string array <em class="parameter"><code>str_array</code></em>
.</p>
<div class="refsect3">
<a name="g-strv-length.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>str_array</p></td>
<td class="parameter_description"><p>a <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated array of strings</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strv-length.returns"></a><h4>Returns</h4>
<p> length of <em class="parameter"><code>str_array</code></em>
.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-6.html#api-index-2.6">2.6</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-strv-contains"></a><h3>g_strv_contains ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>
g_strv_contains (<em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> * const *strv</code></em>,
                 <em class="parameter"><code>const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="type">gchar</span></a> *str</code></em>);</pre>
<p>Checks if <em class="parameter"><code>strv</code></em>
 contains <em class="parameter"><code>str</code></em>
. <em class="parameter"><code>strv</code></em>
 must not be <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>.</p>
<div class="refsect3">
<a name="g-strv-contains.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>strv</p></td>
<td class="parameter_description"><p>a <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a>-terminated array of strings</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>str</p></td>
<td class="parameter_description"><p>a string</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strv-contains.returns"></a><h4>Returns</h4>
<p> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if <em class="parameter"><code>str</code></em>
is an element of <em class="parameter"><code>strv</code></em>
, according to <a class="link" href="glib-Hash-Tables.html#g-str-equal" title="g_str_equal ()"><code class="function">g_str_equal()</code></a>.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-44.html#api-index-2.44">2.44</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-strerror"></a><h3>g_strerror ()</h3>
<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_strerror (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="type">gint</span></a> errnum</code></em>);</pre>
<p>Returns a string corresponding to the given error code, e.g. "no
such process". Unlike <code class="function">strerror()</code>, this always returns a string in
UTF-8 encoding, and the pointer is guaranteed to remain valid for
the lifetime of the process.</p>
<p>Note that the string may be translated according to the current locale.</p>
<p>The value of <code class="literal">errno</code> will not be changed by this function. However, it may
be changed by intermediate function calls, so you should save its value
as soon as the call returns:</p>
<div class="informalexample">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4
5
6</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="gtkdoc kwb">int</span> saved_errno<span class="gtkdoc opt">;</span>

ret <span class="gtkdoc opt">=</span> <span class="function">read</span> <span class="gtkdoc opt">(</span>blah<span class="gtkdoc opt">);</span>
saved_errno <span class="gtkdoc opt">=</span> errno<span class="gtkdoc opt">;</span>

<span class="function"><a href="glib-String-Utility-Functions.html#g-strerror">g_strerror</a></span> <span class="gtkdoc opt">(</span>saved_errno<span class="gtkdoc opt">);</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

<p></p>
<div class="refsect3">
<a name="g-strerror.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>errnum</p></td>
<td class="parameter_description"><p>the system error number. See the standard C <code class="literal">errno</code>
documentation</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strerror.returns"></a><h4>Returns</h4>
<p> a UTF-8 string describing the error code. If the error code
is unknown, it returns a string like "unknown error (&lt;code&gt;)".</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-strsignal"></a><h3>g_strsignal ()</h3>
<pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar" title="gchar"><span class="returnvalue">gchar</span></a> *
g_strsignal (<em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint ()"><span class="type">gint</span></a> signum</code></em>);</pre>
<p>Returns a string describing the given signal, e.g. "Segmentation fault".
You should use this function in preference to <code class="function">strsignal()</code>, because it
returns a string in UTF-8 encoding, and since not all platforms support
the <code class="function">strsignal()</code> function.</p>
<div class="refsect3">
<a name="g-strsignal.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>signum</p></td>
<td class="parameter_description"><p>the signal number. See the <code class="literal">signal</code> documentation</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-strsignal.returns"></a><h4>Returns</h4>
<p> a UTF-8 string describing the signal. If the signal is unknown,
it returns "unknown signal (&lt;signum&gt;)".</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="glib-String-Utility-Functions.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="G-ASCII-DTOSTR-BUF-SIZE:CAPS"></a><h3>G_ASCII_DTOSTR_BUF_SIZE</h3>
<pre class="programlisting">#define G_ASCII_DTOSTR_BUF_SIZE (29 + 10)
</pre>
<p>A good size for a buffer to be passed into <a class="link" href="glib-String-Utility-Functions.html#g-ascii-dtostr" title="g_ascii_dtostr ()"><code class="function">g_ascii_dtostr()</code></a>.
It is guaranteed to be enough for all output of that function
on systems with 64bit IEEE-compatible doubles.</p>
<p>The typical usage would be something like:</p>
<div class="informalexample">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="gtkdoc kwb">char</span> buf<span class="gtkdoc opt">[</span>G_ASCII_DTOSTR_BUF_SIZE<span class="gtkdoc opt">];</span>

<span class="function">fprintf</span> <span class="gtkdoc opt">(</span>out<span class="gtkdoc opt">,</span> <span class="string">&quot;value=%s</span><span class="gtkdoc esc">\n</span><span class="string">&quot;</span><span class="gtkdoc opt">,</span> <span class="function"><a href="glib-String-Utility-Functions.html#g-ascii-dtostr">g_ascii_dtostr</a></span> <span class="gtkdoc opt">(</span>buf<span class="gtkdoc opt">,</span> <span class="keyword">sizeof</span> <span class="gtkdoc opt">(</span>buf<span class="gtkdoc opt">),</span> value<span class="gtkdoc opt">));</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

<p></p>
</div>
<hr>
<div class="refsect2">
<a name="GNumberParserError"></a><h3>enum GNumberParserError</h3>
<p>Error codes returned by functions converting a string to a number.</p>
<div class="refsect3">
<a name="GNumberParserError.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="G-NUMBER-PARSER-ERROR-INVALID:CAPS"></a>G_NUMBER_PARSER_ERROR_INVALID</p></td>
<td class="enum_member_description">
<p>String was not a valid number.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="G-NUMBER-PARSER-ERROR-OUT-OF-BOUNDS:CAPS"></a>G_NUMBER_PARSER_ERROR_OUT_OF_BOUNDS</p></td>
<td class="enum_member_description">
<p>String was a number, but out of bounds.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-2-54.html#api-index-2.54">2.54</a></p>
</div>
<hr>
<div class="refsect2">
<a name="G-NUMBER-PARSER-ERROR:CAPS"></a><h3>G_NUMBER_PARSER_ERROR</h3>
<pre class="programlisting">#define G_NUMBER_PARSER_ERROR (g_number_parser_error_quark ())
</pre>
<p>Domain for errors returned by functions converting a string to a
number.</p>
<p class="since">Since: <a class="link" href="api-index-2-54.html#api-index-2.54">2.54</a></p>
</div>
<hr>
<div class="refsect2">
<a name="G-STR-DELIMITERS:CAPS"></a><h3>G_STR_DELIMITERS</h3>
<pre class="programlisting">#define	 G_STR_DELIMITERS "_-|&gt; &lt;."
</pre>
<p>The standard delimiters, used in <a class="link" href="glib-String-Utility-Functions.html#g-strdelimit" title="g_strdelimit ()"><code class="function">g_strdelimit()</code></a>.</p>
</div>
<hr>
<div class="refsect2">
<a name="GStrv"></a><h3>GStrv</h3>
<pre class="programlisting">typedef gchar** GStrv;
</pre>
<p>A typedef alias for gchar**. This is mostly useful when used together with
<a class="link" href="glib-Miscellaneous-Macros.html#g-auto" title="g_auto()"><code class="function">g_auto()</code></a>.</p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.26.1</div>
</body>
</html>